我要参考的安装流程
http://blog.csdn.net/beyond__devil/article/details/68064202
我遇到的错误及解决方法:
1.如果你之前安装过go,那么再次安装前,你需要将安装的go卸载干净。
2.基于上述安装流程,笔者checkout到1.4.3版本,并运行./all.bash,出现以下错误
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
解决方案:
在命令行输入:export CGO_ENABLED=0
问题解决,编译好的1.4.3在终端上打出的结果如下
Installed Go for linux/amd64 in /home/xxx/go
Installed commands in /home/xxx/go/bin
3.查看github官网的版本,我将版本checkout到1.9.4版本,运行./all.bash,运行成功,结果如下:
##### API check
Go version is "go1.9.4", ignoring -next /home/xxx/go/api/next.txt
ALL TESTS PASSED
---
Installed Go for linux/amd64 in /home/xxx/go
Installed commands in /home/xxx/go/bin
*** You need to add /home/xxx/go/bin to your PATH.
配置环境变量后,我以为已经成功了,但是当我使用go install进行编译时,出现以下错误:
($GOPATH not set. For more details see: 'go help gopath')
没有评论:
发表评论