Original post

If vscode doesn’t still handle . files well for you, here’s a simple fix you can try. Always run:

go mod init

In your project root directory. I know this will add the project root to your import paths, but it’s a sacrifice worth giving, as vscode could get frustrating.