Skip to content

cmd/go: configure -buildvcs via environment variable #52308

Closed
@zmb3

Description

@zmb3

Would there be any appetite for an environment variable alternative that configures the -buildvcs flag?

Use case - in order to build my project with 1.18 I need to set -buildvcs=false - our repository layout breaks the "main package and the main module containing it are in the repository containing the current directory rule."

If I unconditionally set -buildvcs=false, the project builds successfully on Go 1.18, but fails on 1.17 because it doesn't understand the -buildvcs flag. In order to support both Go versions, I have to add logic to handle version-specific flags.

Something like an environment variable would allow builds on 1.17 and 1.18 to succeed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions