Re:Go 1.17 Release Notes
by galleywest on Monday August 16, 2021 @08:03PM
(#28204487)
Are you using the imports in your file? The VS Code Go addon has "format on save" enabled by default and Go will not compile if there are unused imports - so VS Code deletes the unused imports on save by default.
Otherwise try a "go mod init" in the root of your project.
Otherwise try a "go mod init" in the root of your project.