This could be a problem with the settings for the Extension you are using.
You can uninstall and reinstall the GO Extension and see if it solves the problem.
Else another option is to edit the settings.json file under the settings icon for the GO Extension.
it will be usfull to variefy the GoRoot from terminal using,
$ go evnv
and make sure its mentioned in the settings.json file, if not you need to copy the value under the tag GOROOT="/"
Then go back to the VS code Go Extension settings editor and add it to the following lines, *the settings.json editor can be found under the Edit in settings.json link, Under extension settings. *
{
"window.zoomLevel": -3,
"editor.tabCompletion": "on",
"go.autocompleteUnimportedPackages": true,
"go.installDependenciesWhenBuilding": true,
"go.useCodeSnippetsOnFunctionSuggest": true,
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"go.formatTool": "gofmt",
"go.gocodeAutoBuild": true,
"go.useLanguageServer": true,
"go.goroot": "/Your GoRoot Path",
"go.delveConfig": {
}
}
by setting up the following tags the issues will disappear,
"go.autocompleteUnimportedPackages": true,
"go.goroot": "/Your GoRoot Path",
"editor.tabCompletion": "on",
"go.useLanguageServer": true,
Hope this info helps.