Closed hyangah closed 2 years ago
Change https://golang.org/cl/244758 mentions this issue: src/goDeclaration.ts: godef requires the right
GOROOTenv var
A user reported gocode
(or gocode-gomod
) needed to be reinstalled when go is updated. (https://github.com/golang/vscode-go/issues/552) Need to verify it.
Change https://golang.org/cl/254137 mentions this issue: src/goPackages.ts: pass GOROOT to gopkgs
This extension keeps track of the
GOROOT
used last time inctx.globalState.get('toolsGoInfo')
. If use of a different GOROOT is detected when activated, it prompts users to recompile/reinstall Go tools with a message like:Your current goroot (${currentGoroot}) is different than before (${prevGoroot}), a few Go tools may need recompiling
The code is here https://github.com/golang/vscode-go/blob/89c61d9e3af240858c7b9ea38b4e953b3063b3ad/src/goMain.ts#L94-L127
This was a heuristic to deal with old tools that used the
GOROOT
embedded during the tool's compile time (See https://github.com/microsoft/vscode-go/issues/1286 for example) in old days. Newer tools shouldn't depend on the value ofGOROOT
used in the tool's compile time, so recompiling shouldn't be necessary as long as the tool is up-to-date.Examine tools this extension depends on and check whether they use hard-coded build time
GOROOT
. Once we know no tools require recompilation any more, remove this popup and the heuristic.Inspection status (check if investigated && not require recompilation)
cc @stamblerre @mcjcloud @FiloSottile