cmd/go: improve 'missing $GOPATH' error message when HOME is unset #29341
Labels
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
With reference to #24064, this is a common occurrence when trying to automate the installation of Go programs with tools such as Puppet. System commands are run in an initially empty environment, so a command like:
fails with this error:
But this works fine in a 'normal' interactive environment, because GOPATH is inferred from the value of $HOME. What's missing here is not $GOPATH, per se, but $HOME.
Maybe this error message could be improved, along the lines of:
The text was updated successfully, but these errors were encountered: