小编典典

进行项目构建失败:在此块中重新声明了lfstackPack

go

我是Go语言的新手,在构建项目时,它返回以下错误:

/usr/local/go/bin/go run /home/qiuwei/GoWorkSpace/src/LearnGo/SoHi/Hello.go
# runtime
/usr/local/go/src/runtime/lfstack_amd64.go:16: lfstackPack redeclared in this block
    previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:37
/usr/local/go/src/runtime/lfstack_amd64.go:20: lfstackUnpack redeclared in this block
    previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:41
/usr/local/go/src/runtime/os_linux_generic.go:13: _SS_DISABLE redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:12
/usr/local/go/src/runtime/os_linux_generic.go:14: _NSIG redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:13
/usr/local/go/src/runtime/os_linux_generic.go:15: _SI_USER redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:14
/usr/local/go/src/runtime/os_linux_generic.go:16: _SIG_BLOCK redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:15
/usr/local/go/src/runtime/os_linux_generic.go:17: _SIG_UNBLOCK redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:16
/usr/local/go/src/runtime/os_linux_generic.go:18: _SIG_SETMASK redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:17
/usr/local/go/src/runtime/os_linux_generic.go:19: _RLIMIT_AS redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:18
/usr/local/go/src/runtime/os_linux_generic.go:25: sigset redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os2_linux_generic.go:24
/usr/local/go/src/runtime/os_linux_generic.go:25: too many errors

显示我的环境:

export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/GoWorkSpace

转到版本:go1.6.3。作业系统:Ubuntu 14.04

如何解决?


阅读 303

收藏
2020-07-02

共1个答案

小编典典

删除所有提取的文件,然后再次提取1.6 tar。如果仍然遇到问题,也可以尝试重新启动终端。

sudo rm -rf /usr/local/go
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

有关更多详细信息,请参见此

2020-07-02