VS Code + Go extension: Turn off Workspace loading

Viewed 706

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 Answers

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.

Related