英文:
Installing Go Language
问题
我正在尝试安装Go语言,但最后出现了以下错误(我不会复制全部,因为有很多行):
$>=========== fixedbugs/bug359.go
> BUG: errchk: fixedbugs/bug359.go:19: 缺少预期的错误:“'未导出的字段'”
> errchk: fixedbugs/bug359.go:25: 缺少预期的错误:“'a 重新声明'”
> errchk: 未匹配的错误消息:
> ==================================================
> fixedbugs/bug359.go:12: 导入 /home/anju/go/pkg/linux_386/container/list.a:
对象是 [linux 386 release.r56 9441] 预期是 [linux 386 release.r60.3 10088+]
> ==================================================
0 个已知错误;78 个意外错误;测试输出不同
失败
我按照步骤一步一步地进行了操作,但始终得到相同的结果。我在我的.bashrc文件中编辑了以下内容:
export GOROOT=$HOME/go
export GOARCH=386
export GOOS=linux
export GOBIN=$HOME/bin
export PATH=$GOBIN:$PATH
但是当我执行uname -a命令时,我得到了以下结果:
$Linux Anju 2.6.32-35-generic #78-Ubuntu SMP Tue Oct 11 15:27:15 UTC 2011 i686 GNU/Linux.
所以,GOARCH=386是正确的,还是我应该使用其他值?
感谢您的关注,对我的糟糕英语表示抱歉。
英文:
I'm trying to install Go language, but at the end, I got these errors (I won't copy all because are a lot of lines):
$>=========== fixedbugs/bug359.go
> BUG: errchk: fixedbugs/bug359.go:19: missing expected error: '"unexported field"'
> errchk: fixedbugs/bug359.go:25: missing expected error: '"a redeclared"'
> errchk: unmatched error messages:
> ==================================================
> fixedbugs/bug359.go:12: import /home/anju/go/pkg/linux_386/container/list.a:
object is [linux 386 release.r56 9441] expected [linux 386 release.r60.3 10088+]
> ==================================================
0 known bugs; 78 unexpected bugs; test output differs
FAILED
I've followed step by step the instructions, but always I get the same results. I edited my .bashrc with ne next lines:
export GOROOT=$HOME/go
export GOARCH=386
export GOOS=linux
export GOBIN=$HOME/bin
export PATH=$GOBIN:$PATH
But when I execute the command uname -a, I get these:
$Linux Anju 2.6.32-35-generic #78-Ubuntu SMP Tue Oct 11 15:27:15 UTC 2011 i686 GNU/Linux.
So, GOARCH=386 it's ok or maybe I should use another value?
Thanks for the attention and excuse me my bad english.
答案1
得分: 2
标准的$GOBIN
默认值是:
export GOBIN=$GOROOT/bin
你可能安装了多个版本的Go。例如,[linux 386 release.r56 9441]
和[linux 386 release.r60.3 10088+]
。因此,你可能有多个版本的Go二进制文件,比如8g
,可能存在于$HOME/bin
和$GOROOT/bin
($HOME/go/bin
)中。
英文:
The standard default for $GOBIN
is:
export GOBIN=$GOROOT/bin
You probably have multiple versions of Go installed. For example, [linux 386 release.r56 9441]
and [linux 386 release.r60.3 10088+]
. Therefore, you probably have multiple versions of Go binaries such as 8g
, perhaps in both $HOME/bin
and $GOROOT/bin
($HOME/go/bin
).
答案2
得分: 0
我找到了一个教程,但是我对终端不太熟悉,所以无法弄清楚。
英文:
i found a tutorial but i am not comfortable with terminal so can't figure it. http://www.kelvinwong.ca/2009/11/12/installing-google-go-on-mac-os-x-leopard/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论