Skip to content

Commit 265bf23

Browse files
committed
[release] src/goMain.ts: reinstate the goroot var interpolation
Add back the feature that resolves ~, ${workspaceFolder}, ${workspaceRoot} included in "go.goroot". This feature was available since 0.6.72, but accidentally lost during the 0.15 dev cycle when we restructured the handling of `GOROOT`. Fixes #464 Change-Id: I373cdc8de02d3d1764ca939b6ca6299216a6496e Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/246518 Reviewed-by: Brayden Cloud <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> (cherry picked from commit c6695aa) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/246997
1 parent 634aa30 commit 265bf23

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/goMain.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ import {
5858
getToolsGopath,
5959
getWorkspaceFolderPath,
6060
handleDiagnosticErrors,
61-
isGoPathSet
61+
isGoPathSet,
62+
resolvePath,
6263
} from './util';
6364
import { clearCacheForTools, envPath, fileExists, getCurrentGoRoot, setCurrentGoRoot } from './utils/goPath';
6465

@@ -78,7 +79,7 @@ export function activate(ctx: vscode.ExtensionContext) {
7879

7980
const configGOROOT = getGoConfig()['goroot'];
8081
if (!!configGOROOT) {
81-
setCurrentGoRoot(configGOROOT);
82+
setCurrentGoRoot(resolvePath(configGOROOT));
8283
}
8384

8485
updateGoVarsFromConfig().then(async () => {

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ export function getBinPath(tool: string, useCache = true): string {
484484
return getBinPathWithPreferredGopathGoroot(
485485
tool,
486486
tool === 'go' ? [] : [getToolsGopath(), getCurrentGoPath()],
487-
tool === 'go' && cfg.get('goroot') ? cfg.get('goroot') : undefined,
487+
tool === 'go' && cfg.get('goroot') ? resolvePath(cfg.get('goroot')) : undefined,
488488
selectedGoPath ?? resolvePath(alternateToolPath),
489489
useCache
490490
);

0 commit comments

Comments
 (0)