cmd/go: default -mod=vendor
behavior unexpectedly present in workspace mode
#54130
Labels
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (also reproduces on 1.18.4)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go.work
file andvendor
directory containing a fake librarygo build
, and then./my_workspace
What did you expect to see?
The documentation implies that workspace mode and vendoring are incompatible:
By default, if the go version in go.mod is 1.14 or higher and a vendor directory is present, the go command acts as if -mod=vendor were used.
from Go Modules Referencego build -mod=vendor
produces an error:The original workspace proposal explicitly stated that vendoring is ignored in workspace mode:
What did you see instead?
Explicitly specifying
-mod=readonly
(which theoretically is the only option value compatible with workspace mode):The text was updated successfully, but these errors were encountered: