Skip to content

cmd/go: fail if the user tries to modify the GOMOD environment variable #51217

@mvdan

Description

@mvdan

See #51171 (comment). The user likely wants to either use -modfile, or cd into the right directory to enter or leave a module. Right now, a command like GOMOD=foo.mod go list will happily ignore GOMOD=foo.mod.

cc @bcmills @matloob

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.help wantedmodules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions