Extract "go" folder from the goX.X.X.src.tar.gz to home directory.
Edit file .bashrc and add:
export GOROOT=$HOME/goBased on my OS (Ubuntu 14.04 64 bit), also add:
export PATH=$PATH:$GOROOT/bin
export GOARCH=amd64
export GOOS=linux
First make sure gcc and libc6-dev already installed. From terminal:
sudo apt-get install gcc libc6-dev
Now build from ~/go/src by executing all.bash
When done building, it shows:
Then create folder named "gocode" in home directory, and write file hello.go to test the installation by running command "go run hello.go".
No comments:
Post a Comment