Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: improve 'missing $GOPATH' error message when HOME is unset #29341
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: