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

x/tools/cmd/getgo: error "go: cannot find GOROOT directory: /usr/local/go" #21271

Closed
Deleplace opened this issue Aug 2, 2017 · 3 comments
Closed

Comments

@Deleplace
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

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

none

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

(no go env)
Linux SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64

What did you do?

Created a new small GCE instance (1 vcpu, 4GB memory)
Opened SSH access
Copy-pasted and executed the one-liner go installer :

curl -LO https://get.golang.org/$(uname)/go_installer && chmod +x go_installer && ./go_inst
aller && rm go_installer

And then

go version

What did you expect to see?

Some recent go1.8.3 version number

What did you see instead?

go: cannot find GOROOT directory: /usr/local/go

Same error message for go doc fmt or go get github.com/gorilla/mux.
See this gist for complete terminal trace.

@seankhliao
Copy link
Member

seankhliao commented Aug 2, 2017

From the docs

Your Install as a local user (to $HOME/.go) counts as a custom location and as such GOROOT and GOPATH should be manually set

export GOROOT=$HOME/go1.X
export PATH=$PATH:$GOROOT/bin

@Deleplace
Copy link
Contributor Author

Deleplace commented Aug 2, 2017

Hello Sean Liao
The relevant doc is here : cmd/getgo
With this issue I was following instructions from this thread

The one-liner installer project is specifically designed "to both install Go as well as do the initial configuration of setting up the right environment variables and paths" so I don't have to do it myself.

I expect that all upcoming new issues with subject starting with "tools/cmd/getgo" (created by following the link given by Steven Francia) will be about this new tool and thus the official doc/install page won't apply for them.
Cheers

@mikioh mikioh changed the title tools/cmd/getgo:error "go: cannot find GOROOT directory: /usr/local/go" x/tools/cmd/getgo: error "go: cannot find GOROOT directory: /usr/local/go" Aug 2, 2017
@gopherbot gopherbot added this to the Unreleased milestone Aug 2, 2017
@Deleplace
Copy link
Contributor Author

This seems to be fixed!
The exact same actions today give correct results:

$ go version
go version go1.9 linux/amd64

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

3 participants