root@fabric:/opt/gopath/src/github.com/Mango# cd go
root@fabric:/opt/gopath/src/github.com/Mango/go# git checkout release-branch.go1.4
Branch release-branch.go1.4 set up to track remote branch release-branch.go1.4 from origin.
Switched to a new branch 'release-branch.go1.4'
进入src目录,并运行all.bash 安装脚本,稍等片刻即可安装成功:
root@fabric:/opt/gopath/src/github.com/Mango/go# cd src
root@fabric:/opt/gopath/src/github.com/Mango/go/src# ./make.bash
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, linux/amd64.
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
....
# Checking API compatibility.
Skipping cmd/api checks
real0m0.538s
user0m0.310s
sys0m0.191s
ALL TESTS PASSED
---
Installed Go for linux/amd64 in /root/software/go
Installed commands in /root/software/go/bin
*** You need to add /root/software/go/bin to your PATH.
如果遇到报错
cannot load DWARF output from $WORK/os/user/_obj//_cgo_.o: decoding dwarf section info at offset 0x4: unsupported version 0
root@fabric:/opt/gopath/src/github.com/Mango/go/src# cd ../
root@fabric:/opt/gopath/src/github.com/Mango/go# git checkout release-branch.go1.9
Branch release-branch.go1.9 set up to track remote branch release-branch.go1.9 from origin.
Switched to a new branch 'release-branch.go1.9'
下面的过程就和编译go1.4很类似,不再赘述
root@fabric:/opt/gopath/src/github.com/Mango/go# cd src
root@fabric:/opt/gopath/src/github.com/Mango/go# ./make.bash
...