解决vscode报错gopls was not able to find modules in your workspace.
没有go.mod文件
原因是当前目录没有go.mod文件,因此vscode会出现如下报错
1 | gopls was not able to find modules in your workspace. |
执行命令行($ go mod init packagestudy)
即可
在文件同级目录下初始化一个新的Go模块,会自动创建一个(go.mod)
文件
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 痴呆呆子のBlog!