Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go get should fail if GOPATH is not set #4186

Closed
davecheney opened this issue Oct 2, 2012 · 5 comments
Closed

cmd/go: go get should fail if GOPATH is not set #4186

davecheney opened this issue Oct 2, 2012 · 5 comments
Milestone

Comments

@davecheney
Copy link
Contributor

What steps will reproduce the problem?

For users who have downloaded a binary version of Go (or are using one packaged by their
OS vendor), using go get without GOPATH set will cause the operation to fail as they do
not have permission to write to /usr/local/go (or similar path). This is confusing and
leads to behaviour like chmod'ing their Go installation a+w.

While GOPATH is documented in the installation documentation, over the past 6 months is
has been a common stumbling block for new Go users.

I suggest that go get should refuse to download a package if GOPATH is not set and exit
with a message directing users to a solution.

Please use labels and text to provide additional information.

Proposed fix and discussion, http://golang.org/cl/6397048/
@adg
Copy link
Contributor

adg commented Oct 3, 2012

Comment 1:

I agree with Russ' suggestion: we should print some kind of specific warning if "go get"
fails and GOPATH is not set.

@davecheney
Copy link
Contributor Author

Comment 2:

From IRC today
16:22 < heatxsink> i'm trying to install https://github.com/moovweb/gokogiri.git
and i'm getting  .... 
                   https://gist.github.com/870bfdba0f8564de2aea
16:23 < davecheney> heatxsink: you have not set GOPATH
16:24 < shawnps_> heatxsink: http://golang.org/cmd/go/#GOPATH_environment_variable
:)
16:25 -!- EvilJStoker [jstoker@unaffiliated/jstoker] has quit [Excess Flood]
16:25 < heatxsink> in the past on other machines i had to use a tarball this time
around on OSX there's a pkg how does that effect my 
                   path? the documentation doesn't seem to account for this
16:25 < heatxsink> or my GOPATH
16:25 < heatxsink> not path*

@davecheney
Copy link
Contributor Author

Comment 3:

Owner changed to @davecheney.

Status changed to Started.

@davecheney
Copy link
Contributor Author

@davecheney
Copy link
Contributor Author

Comment 5:

This issue was closed by revision 593d8b0.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants