报错Error loading workspace: gopls was not able to find modules in your workspace. When outside of GOPATH, gopls needs to know which modules you are working on.
尝试了加入
"gopls": {
"experimentalWorkspaceModule": true,
},
以及使用go work指明纳入工作区的的module,但是都没有软用.什么都不写都能出现上述报错,然后更具报错信息,在主目录下尝试使用go work init 然后就成功执行,报错消失.