无法在Fedora 31中安装gopls

vshtjzan  于 2022-12-07  发布在  Go
关注(0)|答案(2)|浏览(120)

我下面有围棋版本

$ go version
go version go1.14.3 linux/amd64

$ which 
/usr/local/go/bin/go

GOPATH设置为

$ echo $GOPATH
    /home/raj/go

PATH变量设置为-

$ echo $PATH
/home/raj/.cargo/bin:/home/raj/go/bin:/home/raj/.cabal/bin:/home/raj/.ghcup/bin:/home/raj/.cargo/bin:/home/raj/.cabal/bin:/home/raj/.ghcup/bin:/home/raj/.cabal/bin:/home/raj/.ghcup/bin:/home/raj/.cargo/bin:/home/raj/.cabal/bin:/home/raj/.ghcup/bin:/home/raj/.cargo/bin:/home/raj/.cabal/bin:/home/raj/.ghcup/bin:/home/raj/.sdkman/candidates/maven/current/bin:/home/raj/.sdkman/candidates/java/current/bin:/home/raj/.sdkman/candidates/gradle/current/bin:/home/raj/.cargo/bin:/home/raj/.cabal/bin:/home/raj/.ghcup/bin:/home/raj/.local/bin:/home/raj/bin:/home/raj/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/var/lib/snapd/snap/bin:/usr/local/go/bin:/home/raj/bin:/home/raj/Deps/cmake/3.16.5/cmake/bin/:/usr/local/go/bin:/home/raj/bin:/home/raj/Deps/cmake/3.16.5/cmake/bin/:/usr/local/go/bin:/home/raj/bin:/home/raj/Deps/cmake/3.16.5/cmake/bin/

如您所见,/home/raj/go/bin位于PATH中
现在,我正在尝试安装gopls,但出现以下错误-
最golang.org/x/tools/gopls@latest版本=〉v0.4.1运行时/内部/原子

运行时/内部/原子

/usr/本地/go/源代码/运行时/内部/原子/原子_amd64x.go:13:6:在此块中重新声明的加载先前在/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:16:24处的声明在此块中重新声明了Loadp,之前的声明位于/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:22:32 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:25:6:在此块中重新声明了Load 64,之前的声明位于/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:28:26 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:31:6:在此块中重新声明了LoadAcq,之前的声明位于/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:34:27 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:36:6:在此块中重新声明了Xadd,以前的声明位于/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:39:37 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:39:6:Xadd 64在此块中重新声明,之前的声明位于/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:42:39 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:42:6:在这个块中重新声明了Xadduintptr,之前的声明位于/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:45:47 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:45:6:Xchg在此块中重新声明了之前在/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:48:36 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:48:6处的声明:Xchg 64在此块中重新声明了之前在/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:51:38 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:51:6处的声明:在此块中重新声明了Xchguintptr,之前的声明位于/usr/local/go/src/runtime/internal/atomic/atomic_amd64.go:54:45 /usr/local/go/src/runtime/internal/atomic/atomic_amd64x.go:51:6:错误过多
为什么会出现此错误?如何修复此错误?
注意:我的操作系统详细信息是-

$ lsb_release -a
    LSB Version:    :core-4.1-amd64:core-4.1-noarch
    Distributor ID: Fedora
    Description:    Fedora release 31 (Thirty One)
    Release:        31
    Codename:       ThirtyOne
zpgglvta

zpgglvta1#

正如@Jimb评论的那样,我删除了Go安装sudo rm -rf /usr/local/go,重新安装了Go,它工作正常。

fkaflof6

fkaflof62#

我也遇到了同样的问题,我的问题是我安装了gcc-go软件包,由于某种原因,它不能与Vscode扩展一起工作,但是当我删除它并下载了golang软件包时,一切都立即工作了。也许这能帮助一些人。

相关问题