Skip to content

cmd/go: allow -getmode=vendor in environment variable #26585

Closed

Description

@surajbarkale

What version of Go are you using (go version)?

go1.11beta2

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.

This issue is generated from a unaddressed comment made on a closed issue.

Activity

  1. rsc commented on Jul 25, 2018

    @rsc
    Contributor

    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.

  2. 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
  3. surajbarkale commented on Jul 25, 2018

    @surajbarkale
    Author

    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:

    1. New dependencies (or updates to existing once) are brought in by individual devs.
    2. The resulting vendor folder is committed to git along with the lock files.
    3. 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.

  4. gopherbot commented on Jul 29, 2018

    @gopherbot
    Contributor

    Change https://golang.org/cl/126656 mentions this issue: cmd/go: add $GOFLAGS environment variable

  5. locked and limited conversation to collaborators on Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions