]> Cypherpunks repositories - gostls13.git/commit
cmd/go: set go.work path using GOWORK, and remove -workfile flag
authorMichael Matloob <matloob@golang.org>
Tue, 15 Feb 2022 19:27:13 +0000 (14:27 -0500)
committerMichael Matloob <matloob@golang.org>
Wed, 16 Feb 2022 15:58:47 +0000 (15:58 +0000)
commit5d8d3878496918d51347422d651629975343b18e
tree2fc0322b6ea0cf5097cc45ec907fa2762de8a18a
parent293ecd87c10eb5eed777d220394ed63a935b2c20
cmd/go: set go.work path using GOWORK, and remove -workfile flag

This change removes the -workfile flag and allows the go.work file path
to be set using GOWORK (which was previously read-only). This removes
the potential discrepancy and confusion between the flag and environment
variable.

GOWORK will still return the actual path of the go.work file found if it
is set to '' or 'auto'. GOWORK will return 'off' if it is set to 'off'.

For #45713
Fixes #51171

Change-Id: I72eed65d47c63c81433f2b54158d514daeaa1ab3
Reviewed-on: https://go-review.googlesource.com/c/go/+/385995
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
27 files changed:
doc/go1.18.html
src/cmd/go/alldocs.go
src/cmd/go/internal/base/flag.go
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/internal/envcmd/env.go
src/cmd/go/internal/help/helpdoc.go
src/cmd/go/internal/list/list.go
src/cmd/go/internal/modcmd/download.go
src/cmd/go/internal/modcmd/graph.go
src/cmd/go/internal/modcmd/verify.go
src/cmd/go/internal/modcmd/why.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/run/run.go
src/cmd/go/internal/test/testflag.go
src/cmd/go/internal/work/build.go
src/cmd/go/internal/workcmd/edit.go
src/cmd/go/internal/workcmd/init.go
src/cmd/go/internal/workcmd/sync.go
src/cmd/go/internal/workcmd/use.go
src/cmd/go/testdata/script/work.txt
src/cmd/go/testdata/script/work_edit.txt
src/cmd/go/testdata/script/work_env.txt
src/cmd/go/testdata/script/work_gowork.txt [new file with mode: 0644]
src/cmd/go/testdata/script/work_init_gowork.txt [moved from src/cmd/go/testdata/script/work_init_workfile.txt with 52% similarity]
src/cmd/go/testdata/script/work_nowork.txt
src/cmd/go/testdata/script/work_workfile.txt [deleted file]
src/internal/cfg/cfg.go