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
Now that Go 1.14 recognizes the vendor folder automatically, go get operations should automatically populate the vendor folder as well.
This will save programmers from having to do go get <module> && go mod vendor to just doing go get <module> -- It reduces two steps into one and from personal experience, it is what people expect the behavior to be and are surprised when they run into a compilation error and realize they have to run a follow up command aka go mod vendor.
Reasoning
This provides both consistency and better developer experience. If go build automatically uses the vendor folder, then go get should also do the same and therefore go build should succeed.
Question
If this proposal is accepted, should it be scoped to the go get command only and not other commands such as go mod tidy and go list?
What version of Go are you using (go version)?
1.14
Does this issue reproduce with the latest release?
Yes
What did you do?
mkdir tempdir && cd tempdir && go mod init tempdir
The vendor directory automatically populated, without having to run a follow up go mod vendor command.
What did you see instead?
go: inconsistent vendoring in /tempdir:
github.com/sirupsen/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory
The text was updated successfully, but these errors were encountered:
Summary
Now that Go 1.14 recognizes the vendor folder automatically,
go get
operations should automatically populate the vendor folder as well.This will save programmers from having to do
go get <module> && go mod vendor
to just doinggo get <module>
-- It reduces two steps into one and from personal experience, it is what people expect the behavior to be and are surprised when they run into a compilation error and realize they have to run a follow up command aka go mod vendor.Reasoning
This provides both consistency and better developer experience. If
go build
automatically uses the vendor folder, thengo get
should also do the same and thereforego build
should succeed.Question
If this proposal is accepted, should it be scoped to the
go get
command only and not other commands such asgo mod tidy
andgo list
?What version of Go are you using (
go version
)?1.14
Does this issue reproduce with the latest release?
Yes
What did you do?
mkdir tempdir && cd tempdir && go mod init tempdir
go get github.com/pkg/errors
printf 'package main\nimport _ "github.com/pkg/errors"\nfunc main() {}' > main.go
go mod vendor
go build
go get github.com/sirupsen/logrus
go build
What did you expect to see?
The vendor directory automatically populated, without having to run a follow up
go mod vendor
command.What did you see instead?
The text was updated successfully, but these errors were encountered: