Addem Addem - 1 year ago 109
Linux Question

Installing Go on Linux, testing fails

I'm following the instructions at this page to try to install Go. I have downloaded the file and extracted it without issue. I opened the

file and went to the end of the file where I inserted the indicated
line. I created all the indicated directories to make a tree structure, ran the
command from the bash shell, created the
file as instructed.

Yet when I run
go install
I get the error

can't load package: package cannot find package "" in any of:
/usr/local/go/src/ (from $GOROOT)
/work/src/ (from $GOPATH)

Answer Source

Try this:

export GOPATH=$HOME/work
mkdir src
mv src/

Go expects your source code to be in a directory called src.