Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6445

Can't get Golang to work in Ubuntu

$
0
0

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=$GOPATHexport GOARCH=amd64export GOOS=linuxexport GOBIN=$GOPATH/binexport PATH=$PATH:$GOBIN

Than I've sourced the .bashrc, and tried:

jan@janpc:~$ go versiongo 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 effectscrypt.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 effectpackage 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)

Viewing all articles
Browse latest Browse all 6445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>