我的环境:
VMware 7.1
OS:CentOS6.2 i386(本来在5.7下,死活过不了所有go的test,到os/exec时出错,没解决)
Go v1
参考文章:
yum:
http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/10/10/2205310.html
http://www.centos.bz/2011/11/centos-163-yum-repo/
go:
http://blog.csdn.net/archimedes_zht/article/details/7062181
补充二点:
sudo easy_install mercurial时,报错:
error: Setup script exited with Python headers are required to build Mercurial
于是google,找到这个:
http://d.hatena.ne.jp/ychubachi+tech/20110516/1305521214
运行:
yum install python-devel
再
sudo easy_install mercurial就OK了
在运行:
hg clone -r release https://go.googlecode.com/hg/ go
这条命令时,第一次到显示“adding changesets”,然后没反应了,等了10来分钟
然后ctrl+c,再次运行,这下没任何提示了。。。也反应。。。像假死
无奈,关机:
shutdown -h now
然后重新开机,重新运行:
hg clone -r release https://go.googlecode.com/hg/ go
OK了!
另好像go v1已经不用8g或6g之类的命令编译了,他在安装时会自动检测到你是啥(8g或6g还是5g)
然后编译时用
go build hello.go即可,他会自动根据环境变量调用对应(8g或6g)的来编译
反正我是没找到8g这个命令的,运行8g报找不到这个命令
以上仅是个人猜测,没有在官方找到文档,有找到的吱一声,谢谢了
附在5.7下运行all.bash的报错:(后换os成6.2就过了)
--- FAIL: TestExtraFiles (0.11 seconds)
exec_test.go:158: Something already leaked - closed fd 3
exec_test.go:199: CombinedOutput: exit status 1; output "leaked parent file. fd = 13; want 10\nCOMMAND PID USER FD TYPE DEVICE SIZE NODE NAME\nexec.test 10390 root cwd DIR 8,5 4096 394437 /home/root/go/src/pkg/os/exec\nexec.test 10390 root rtd DIR 8,2 4096 2 /\nexec.test 10390 root txt REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root mem REG 8,2 129900 641955 /lib/ld-2.5.so\nexec.test 10390 root mem REG 8,2 1693812 641956 /lib/libc-2.5.so\nexec.test 10390 root mem REG 8,2 137908 641959 /lib/libpthread-2.5.so\nexec.test 10390 root 0r CHR 1,3 1798 /dev/null\nexec.test 10390 root 1w FIFO 0,6 43904 pipe\nexec.test 10390 root 2w FIFO 0,6 43904 pipe\nexec.test 10390 root 3u REG 8,2 12 320174 /tmp/505117365\nexec.test 10390 root 4r REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root 5r REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root 6r REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root 7r REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root 8r REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root 9r REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root 10r CHR 1,9 950 /dev/urandom\nexec.test 10390 root 11u REG 8,2 12 320174 /tmp/505117365\nexec.test 10390 root 12r CHR 1,3 1798 /dev/null\nexec.test 10390 root 13r REG 8,2 4186998 320173 /tmp/go-build461013371/os/exec/_test/exec.test\nexec.test 10390 root 15r FIFO 0,6 43908 pipe\n"
FAIL
FAIL os/exec 0.163s