繁体   English   中英

我在为 vscode 安装 go 工具时遇到一些错误

[英]I am getting some errors in installing go tools for vscode

我正在尝试为 go 语言设置我的 Visual Studio 代码。 但我在安装 gopls 和 go-outline 时遇到了一些错误。

错误

Installing github.com/ramya-rao-a/go-outline@latest FAILED
    {
     "killed": false,
     "code": 1,
     "signal": null,
     "cmd": "C:\\Program Files\\Go\\bin\\go.exe install -v github.com/ramya-rao-a/go-outline@latest",
     "stdout": "",
     "stderr": "C:\\Users\\harsh\\go\\pkg\\mod\\github.com\\ramya-rao-a\\go-outline@v0.0.0-20210608161538-9736a4bde949\\main.go:14:2: read C:\\Users\\harsh\\go\\pkg\\mod\\golang.org\\x\\tools@v0.1.1\\go\\buildutil\\allpackages.go: unexpected NUL in input\n"
    }

Installing golang.org/x/tools/gopls@latest FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "C:\\Program Files\\Go\\bin\\go.exe install -v golang.org/x/tools/gopls@latest",
 "stdout": "",
 "stderr": "go: downloading golang.org/x/tools v0.1.11-0.20220407163324-91bcfb1bdf9c\nverifying github.com/sergi/go-diff@v1.1.0: zip: not a valid zip file\n"
}

错误的屏幕截图。

有没有其他方法来安装这个工具?

尝试使用:

 go env -w GO111MODULE=on

go clean -modcache

并再次安装。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM