I have written a main.go
program and declared the package at the beginning of the code but it flagging red as shown below:
When I hover on the package, it displays the following:
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.
I'd require help on how I can pass this error. Thanks a lot.