Vscode 工作空间有多个 Go 模块时报错
gopls requires a module at the root of your workspace.
You can work with multiple modules by opening each one as a workspace folder.
Improvements to this workflow will be coming soon, and you can learn more here:
https://github.com/golang/tools/blob/master/gopls/doc/workspace.md.go list
解决方式:
ctrl+shift+p 输入命令 >setting
设置 vscode setting.json 添加参数 gopls
{
"gopls": {
"experimentalWorkspaceModule": true
}
}