Ok, So I've downloaded Go 1.1 and put it into $HOME/Documents/go.
Then, I've modified my .bashrc
to be:
export GOPATH=$HOME/Documents/go
export GOROOT=$GOPATH
export GOARCH=amd64
export GOOS=linux
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
Than I've sourced the .bashrc
, and tried:
jan@janpc:~$ go version
go version go1.1 linux/amd64
But I can't get it to compile or install any dependencies. Eg. I try to run my little test program:
jan@janpc:~/Documents/go/src/github.com/jan/scrypt$ go run scrypt.go
warning: GOPATH set to GOROOT (/home/jan/Documents/go) has no effect
scrypt.go:9:3: cannot find package "github.com/dchest/scrypt" in any of:
/home/jan/Documents/go/src/pkg/github.com/dchest/scrypt (from $GOROOT)
($GOPATH not set)
jan@janpc:~/Documents/go/src/github.com/jan/scrypt$
And when I try to install dependencies:
jan@janpc:~/Documents/go/src/github.com/jan/scrypt$ go get "github.com/dchest/scrypt"
warning: GOPATH set to GOROOT (/home/jan/Documents/go) has no effect
package github.com/dchest/scrypt: cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath
It compiles and works fine on mac. I can't figure out whats wrong with my config, if I try to remove $GOROOT
or $GOPATH
nothing works, and I don't know what else to set them to, other than the path to Go.
EDIT:
There is no $GOROOT set on my mac. But if I remove $GOROOT
on ubuntu, I get bunch of errors like these when I try to compile.
cannot find package "fmt" in any of:
/usr/local/go/src/pkg/fmt (from $GOROOT)
/home/jan/Documents/go/src/fmt (from $GOPATH)