You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If -workfile is set to off, workspace mode will be disabled. If it is auto (the default), workspace mode will be enabled if a file named go.work is found in the current directory (or any of its parent directories), and disabled otherwise. If -workfile names a path to an existing file that ends in .work, workspace mode will be enabled. Any other value is an error.
But with the description of -workfile from go help build, it's unclear to me that is implemented or not.
Let's either document it if implemented, or update the proposal if that's not implemented.
$ go help build
in module aware mode, use the given go.work file as a workspace file.
By default or when -workfile is "auto", the go command searches for a
file named go.work in the current directory and then containing directories
until one is found. If a valid go.work file is found, the modules
specified will collectively be used as the main modules. If -workfile
is "off", or a go.work file is not found in "auto" mode, workspace
mode is disabled.
If implemented, clarify the workfile should be an absolute path.
Consider to mention the -workfile flag in the documentation of go help work. Currently there is no mention of this flag.
And, what does go work init do if -workfile flag is provided?
I see that it checks whether the file is an absolute path. But, I don't see it creating the workfile - regardless what value I add, go work init creates a go.work file in the current directory.
For those looking for an explanation and coming to this issue from the search results, the flag -workfile has been replaced with the GOWORK environment variable. The corresponding section of the Go Modules Reference simply hasn't been updated yet.