更新 VSCOD 加载工作区文件夹时出错

Anu*_*ani 2 visual-studio-code vscode-settings prettier prettier-eslint prettier-vscode

每次打开 VS Code 升级后,我都会得到一个Error loading workspace folders甚至所有扩展都不起作用

go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin ibm.com/cloudbroker/order/...]: exit status 1: build flag -mod=readonly only valid when using modules
: packages.Load error[![enter image description here][1]][1]
Run Code Online (Sandbox Code Playgroud)

go 版本 go1.12.17 darwin/amd64 VsCode 版本:1.52.1 操作系统:Darwin x64 20.2.0

图像错误消息

在此处输入图片说明

小智 6

1 月 28 日标志着 gopls 和 VS Code Go 旅程中的一个重要里程碑,因为 Gopls 现在默认在 VS Code 的 Go 扩展中启用。

https://blog.golang.org/gopls-vscode-go

您需要在 settings.json 中禁用 go.useLanguageServer 标志

我的看起来像这样:

{
    "go.inferGopath": false,
    "go.toolsGopath": "C:\\Go",
    "go.useLanguageServer": false
}
Run Code Online (Sandbox Code Playgroud)