我编写了一个main.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.
Run Code Online (Sandbox Code Playgroud)
我需要有关如何传递此错误的帮助。多谢。