Linux に Go をインストールする手順
-
wget https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz -
tar -C /usr/local/ -xzf go1.7.4.linux-amd64.tar.gz -
#/etc/profile に変数を追加する
vi /etc/profile- #Go の環境変数
export GOROOT=/usr/local/go/binexport GOPATH=$PATH:$GOROOT/binsource /etc/profile
-
現在のバージョンを確認する
go version -
Go をビルドする
/usr/local/go/src./all.bash
NOTICE
- 以前のバージョン(go1.6)が入っていなければ、先に古いバージョンをインストールしてから新しいものを入れる必要がある。