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
{{ message }}
Repository navigation
cmd/go: allow -getmode=vendor in environment variable #26585
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
darwin/amd64
Feature request
Can we please have an environment variable which would enable the relevant vgo operations to always use -getmode=vendor (or any other value)? Something like GOMODULE_GETMODE?
The reason is that while $enterprise borderline caching proxies are a good thing—in theory, in practice we here at $dayjob are not yet ready to deploy something like this and are already using vendoring as an almost perfect solution to combat both the different variants of the "left-pad problem" (including the "github is down" one) and the versioning problem—everyone get the set of vendored packages of blessed versions, and the vendored packages get upgraded by explicit manual intervention after much discussion and experimentation and tests.
We'd like this to be working as easy as it is now in perpetuity, if possible.
changed the title [-]Provide environment variable to set -getmode=vendor for all go mod operations[/-][+]cmd/go: allow -getmode=vendor in environment variable[/+]on Jul 25, 2018
Even though I work in a large organisation, my team is the only one that uses go. We are unable to set up extra infrastructure (metadata servers, proxies) because of manpower required to maintain it is not available.
The vendor directory workflow has been instrumental in supporting go internally. We have following workflow:
New dependencies (or updates to existing once) are brought in by individual devs.
The resulting vendor folder is committed to git along with the lock files.
When building the code, no internet access is needed for individual developers or CI machines.
I am expecting modules to support this workflow without developers having to jump through hoops every time.
Setting environment variable which can be overridden from command line is one option. Other option is to specify the default getmode in go.mod and override it from command line option.
In day-to-day operations, I want devs to be able to just execute go build or go test and not have to worry about dealing with missing dependencies.
Activity
rsc commentedon Jul 25, 2018
To date we have never provided an environment variable that duplicates a command-line flag in the go command. I'm reluctant to start now.
[-]Provide environment variable to set -getmode=vendor for all go mod operations[/-][+]cmd/go: allow -getmode=vendor in environment variable[/+]surajbarkale commentedon Jul 25, 2018
Even though I work in a large organisation, my team is the only one that uses go. We are unable to set up extra infrastructure (metadata servers, proxies) because of manpower required to maintain it is not available.
The
vendordirectory workflow has been instrumental in supporting go internally. We have following workflow:I am expecting modules to support this workflow without developers having to jump through hoops every time.
Setting environment variable which can be overridden from command line is one option. Other option is to specify the default getmode in
go.modand override it from command line option.In day-to-day operations, I want devs to be able to just execute
go buildorgo testand not have to worry about dealing with missing dependencies.gopherbot commentedon Jul 29, 2018
Change https://golang.org/cl/126656 mentions this issue:
cmd/go: add $GOFLAGS environment variable