drxdai15012937753
2016-08-21 12:38 阅读 73
已采纳

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

I am new to Go, when I built my project, it returned the following the error:

/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

Show my go env:

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

Go version: go1.6.3. OS: Ubuntu 14.04

How to fix it?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    douba2705 douba2705 2016-08-22 15:12

    Remove all the extracted files and extract the 1.6 tar again. If you are still seeing the issue, you may try restarting your Terminal as well.

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

    For more detail, see this

    点赞 评论 复制链接分享

相关推荐