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 help gopath" gives no information on how to set $GOPATH #18294

Closed
Deozaan opened this issue Dec 13, 2016 · 13 comments
Closed

cmd/go: "go help gopath" gives no information on how to set $GOPATH #18294

Deozaan opened this issue Dec 13, 2016 · 13 comments

Comments

@Deozaan
Copy link

Deozaan commented Dec 13, 2016

What version of Go are you using (go version)?

go version go1.7.4 windows/amd64

What operating system and processor architecture are you using (go env)?

Windows 10 (amd64)

What did you do?

I installed Go and tried to install golint (go get -u -v github.com/golang/lint/golint), but got the following error:

package github.com/golang/lint/golint: cannot download, $GOPATH not set. For more details see: go help gopath

What did you expect to see?

I expected information on how to resolve the error. Namely: How to set $GOPATH.

What did you see instead?

I typed go help gopath and got a lot of details about $GOPATH and what it is used for and the directory structure(s) it requires, but no details on how to actually set the $GOPATH.

@Deozaan Deozaan changed the title go help gopath gives no information on how to set $GOPATH "go help gopath" gives no information on how to set $GOPATH Dec 13, 2016
@bradfitz bradfitz changed the title "go help gopath" gives no information on how to set $GOPATH cmd/go: "go help gopath" gives no information on how to set $GOPATH Dec 13, 2016
@bradfitz bradfitz added this to the Go1.8Maybe milestone Dec 13, 2016
@bradfitz
Copy link
Contributor

/cc @broady @rakyll @rsc

@rakyll
Copy link
Contributor

rakyll commented Dec 13, 2016

We can mention an example GOPATH in the beginning but with Go 1.8, GOPATH will be optional and "$GOPATH not set" error message will not be exposed to the user the way it is now.

@bradfitz
Copy link
Contributor

Still, we should point people at a guide for how to set environment variables.

We have https://golang.org/doc/code.html but it says nothing about Windows environment variables, even though Windows is a huge percentage of our users/downloads.

@rsc
Copy link
Contributor

rsc commented Dec 13, 2016

@rakyll, FWIW, you still get GOPATH not set errors if you have the main Go development repo checked out in $HOME/go. In that case GOPATH has no default setting.

The text for setting the environment variable should be in 'go help gopath', since that's the definitive text and since code.html links to it for more details.

@gopherbot
Copy link

CL https://golang.org/cl/34821 mentions this issue.

gopherbot pushed a commit that referenced this issue Jan 6, 2017
Updates #18294.

Change-Id: Ib6b84243a15ed921cc8960e5fa355fd7594181e6
Reviewed-on: https://go-review.googlesource.com/34821
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@rakyll
Copy link
Contributor

rakyll commented Jan 6, 2017

Well, we created https://golang.org/wiki/EnvVariables#gopath, but I guess it is not reasonable to give a link to this page from go help gopath given the content is breakable by anyone.

@bradfitz
Copy link
Contributor

bradfitz commented Jan 6, 2017

It's not breakable by "anyone". Our wiki is (for better or worse) somewhat locked down.

@broady
Copy link
Contributor

broady commented Jan 6, 2017

wiki links are more likely to go stale or get broken - please link to the website where we have control over URLs and redirects.

@bradfitz
Copy link
Contributor

bradfitz commented Jan 6, 2017

@broady, I disagree. We have control over golang.org/wiki/ redirects too. And the content is much easier to update, and requires less stringent code review process, which is rarely required.

@rakyll
Copy link
Contributor

rakyll commented Jan 6, 2017

The website links to the wiki as well. Even if we link to the website, the next step will be broken.

We either need to move the content to a golang.org page or accept the risk and keep an eye on it.

On the brighter side, I assume that any broken link will be reported immediately by the users. That gives me more confidence to give a link from the tool to the wiki.

@gopherbot
Copy link

CL https://golang.org/cl/34918 mentions this issue.

@broady
Copy link
Contributor

broady commented Jan 6, 2017

The website can be updated, the "go" command cannot (as easily). It's baked into the binary.

@rakyll
Copy link
Contributor

rakyll commented Jan 6, 2017

We own the wiki. Wiki can be fixed very easily to keep serving the right content.

@golang golang locked and limited conversation to collaborators Jan 7, 2018
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

6 participants