I've got
export GOPATH=$HOME/Documents/go
in my .zshrc.
When trying to build a project with the following:
sudo go build -o /usr/bin/
I get a
main.go:5:2: cannot find package "github.com/foo/bar" in any of:
/usr/local/go/src/github.com/foo/bar (from $GOROOT)
/Users/JoahJoah/go/src/github.com/foo/bar (from $GOPATH)
I am assuming the "(from $GOPATH)" means the path is whatever I've set my $GOPATH variable to. And
go env
outputs the following:
GOPATH="/Users/Johannes/Documents/go"
The "Documents" part of the path seems to be omitted when using go build.
Is build using a GOPATH from somewhere else?