golang/go

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

Open

#51,217 opened on Feb 15, 2022

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
GoCommandNeedsFixhelp wantedmodules

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

See https://github.com/golang/go/issues/51171#issuecomment-1040765860. 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

Contributor guide