1.wget -c https://storage.googleapis.com/golang/go$VERSION.$OS-$ARCH.tar.gz
2. tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
3.ln -s /usr/local/go/bin/go /usr/local/bin
注:其他go/bin下的程序也用ln -s建立连接
4.修改$HOME/.bash_profile,添加
export GOPATH=/Goworkspace
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
Note:GOROOT must be set only when installing to a custom location.
网友评论