gopls was not able to find modules in your workspace.
When outside of GOPATH, gopls needs to know which modules you are working on.
You can fix this by opening your workspace to a folder inside a Go module, or
by using a go.work file to specify multiple modules.
See the documentation for more information on setting up your workspace:
https://github.com/golang/tools/blob/master/gopls/doc/workspace.md.
Solution:
zzh@ZZHPC:~/zd/MyPrograms/Go$ go work init
- workspace modules VSCode error goplsworkspace modules vscode error jenkins node_modules postinstall workspace workspace package笔记module workspace python vscode node_modules modules文件vscode 模块cannot module error 模块vscode python module main vscode return error specified module error java 模块package module error