I downloaded Golang 1.11.1, but in the terminal when I type 'go version,' I get: 'go version go1.6.2 darwin/amd64'.
When I type 'which go' in the terminal, I get: /usr/local/bin/go
I can see in /usr/local that there is a go directory, and when I open the file VERSION, it says 1.11.1
When I try 'go get https://github.com/blablabla' in the terminal, it spits out 'package github.com/google/uuid: cannot download, $GOPATH not set. For more details see: go help gopath'.
What is the issue here? Could it be that I am one of the users (and not the original user) on my mac? To get to my files, I have to go to Users/myusername first... How do I change my GOPATH so that this works?
Thank you -S
Update: I set my $GOPATH to "/Users/myusername/go" by editing my bash_profile, but the version still has not changed, although I re-downloaded Go.
you can try this
You can go to user/local/go/src
if the golang is install .it show many file.
Then you can open terminal. and type go env
after that set the $GOPATH
export GOPATH=/user/local/go
Also set the $GOBIN
export GOBIN= $GOPATH/bin