VS Code + Go扩展:关闭工作区加载

huangapple go评论89阅读模式
英文:

VS Code + Go extension: Turn off Workspace loading

问题

我正在使用主要的Go扩展。我经常使用VS Code,但很少在Go中工作。我也使用Azure,但我不使用或不需要与Go相关的SDK。

安装扩展后,我看到以下错误:

加载工作区时出错:err: 退出状态 1:stderr: go: github.com/Azure/azure-sdk-for-go@v46.0.0+incompatible: 缺少go.sum条目;要添加它:go mod download github.com/Azure/azure-sdk-for-go : packages.Load error

我想我理解了错误和问题,但我不知道如何告诉VS Code,“嘿,我不想要Azure Go SDK。”

在VS Code中,我需要做什么才能标记我不想要它,或者将其关闭?现在,错误显示了那些旋转的死亡箭头,这让我觉得有一个后台任务一直在搜索Azure SDK。无论如何,我宁愿不要让虚假的错误混乱我的IDE。

英文:

I am using the primary Go extension. I use VS Code a lot, but I am only rarely working in Go. I also use Azure, but I do not use or want the SDK associated with Go.

After installing the extension, I see the following error:

> Error loading workspace: err: exit status 1: stderr: go: github.com/Azure/azure-sdk-for-go@v46.0.0+incompatible: missing go.sum entry; to add it: go mod download github.com/Azure/azure-sdk-for-go : packages.Load error

I think I understand the error and the problem, but I do not know how I can tell VS Code, "hey, I don't want the Azure Go SDK."

What do I need to do in VS Code to be able to flag that I do not want this, or to turn it off? Right now, the error shows those spinning arrows of death, which makes me think that there is a background task that keeps searching for the Azure SDK. Regardless, I would rather not have bogus errors cluttering my IDE.

答案1

得分: 1

无论您是否想要使用 Azure Go SDK,您的项目中的 Go 代码已经在使用 github.com/Azure/azure-sdk-for-go@v46.0.0+incompatible,并且扩展程序(&gopls&go)需要它来处理项目中的代码。这是一个真正的错误。

如果您确定您的代码不应该依赖它,请从您的 Go 代码和 go.mod 文件中删除对它的引用,并重新加载窗口。

英文:

Regardless whether you want Azure Go SDK or not, the Go code in your project is already using github.com/Azure/azure-sdk-for-go@v46.0.0+incompatible and the extension (&gopls&go) needs it to process the code in the project. It is a real error.

If you are sure that your code shouldn't depend on it, please remove the reference to it from your go code and go.mod file, and reload the window.

huangapple
  • 本文由 发表于 2021年6月18日 21:34:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/68036115.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定