Golang编译器/设置go路径出现问题

I have attempted setting a go path to multiple directories using export, i.e

export GOPATH=$(mktemp -d)

or

export GOPATH="$HOME/go"

etc.

I have attempted using multiple directories yet when I attempt to run "go get" I always run into the same error.

/usr/lib/go/src/pkg/github.com/golang/protobuf/proto/text.go:39:2: no Go source files in /usr/lib/go/src/pkg/encoding

All signs seem to point to the gopath not being set but I can assure you I have set it multiple times attempting to troubleshoot and when I cd to $GOPATH it brings me to the gopath I set.

If it is of any concern this is the repository I am attempting to access:

https://github.com/layeh/piepan

Thank you

The GOPATH environment variable specifies the location of your workspace. It is likely the only environment variable you'll need to set when developing Go code.

To get started, create a workspace directory and set GOPATH accordingly. Your workspace can be located wherever you like, but we'll use $HOME/go in this document. Note that this must not be the same path as your Go installation.

$ mkdir $HOME/go

$ export GOPATH=$HOME/go

For convenience, add the workspace's bin subdirectory to your PATH:

$ export PATH=$PATH:$GOPATH/bin

you have to add you $GOPATH to $PATH, execute highlighted commands (change to your path)

I had the same problem. GOPATH was set, but not present in "go env". Turns out that I had an older installation of go in /usr/bin/go that superceeded the installation in /usr/local/go/bin/go in my path.

Changing the PATH to ensure that /usr/local/go/bin/go came first solved the issue.