I encountered a situation similar to what @zyros mentioned. When following certain documentation, a go.work
file is often created. To resolve this issue, you can either add your module to the go.work
file or simply delete the file altogether. Once you do this, you should be able to run Go normally.
To check your Go work file, use the command go env GOWORK
. If it returns a result, that is your Go work file. You can either add your module to it or just delete this file.