gpt4 book ai didi

go - 带有WSL Remote + Golang gopls的VSCode安装失败并显示以下错误

转载 作者:行者123 更新时间:2023-12-01 22:23:47 33 4
gpt4 key购买 nike

VSCode尝试安装golang.org/x/tools/gopls时,抛出以下错误。

get "golang.org/x/tools": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools?go-get=1
go: finding golang.org/x/tools v0.0.0-20191108194844-46f05828f2fe
go: downloading golang.org/x/tools/gopls v0.2.0
golang.org/x/tools/internal/lsp/source
# golang.org/x/tools/internal/lsp/source
../../../pkg/mod/golang.org/x/tools@v0.0.0-20200407041343-bf15fae40dea/internal/lsp/source/completion.go:697:21: file.LineStart undefined (type *token.File has no field or method LineStart)
../../../pkg/mod/golang.org/x/tools@v0.0.0-20200407041343-bf15fae40dea/internal/lsp/source/format.go:246:27: fset.File(f.Pos()).LineStart undefined (type *token.File has no field or method LineStart)
../../../pkg/mod/golang.org/x/tools@v0.0.0-20200407041343-bf15fae40dea/internal/lsp/source/format.go:271:13: tok.LineStart undefined (type *token.File has no field or method LineStart)

最佳答案

在尝试使用YouCompleteMe为VIM建立我的完成时遇到了同样的问题:

# golang.org/x/tools/internal/lsp/source
third_party/go/pkg/mod/golang.org/x/tools@v0.0.0-20200407041343-bf15fae40dea/internal/lsp/source/completion.go:697:21: file.LineStart undefined (type *token.File has no field or method LineStart)
third_party/go/pkg/mod/golang.org/x/tools@v0.0.0-20200407041343-bf15fae40dea/internal/lsp/source/format.go:246:27: fset.File(f.Pos()).LineStart undefined (type *token.File has no field or method LineStart)
third_party/go/pkg/mod/golang.org/x/tools@v0.0.0-20200407041343-bf15fae40dea/internal/lsp/source/format.go:271:13: tok.LineStart undefined (type *token.File has no field or method LineStart)

解决方案:

从go 1.11.4切换到1.12beta1似乎已经为我解决了这个问题!

关于go - 带有WSL Remote + Golang gopls的VSCode安装失败并显示以下错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61262631/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com