Skip to content

Commit 4763006

Browse files
committed
[release] src/utils/pathUtils: return the default go path only if exists
https://go-review.googlesource.com/c/vscode-go/+/276493 meant to add /usr/local/bin/go to the default path to search, but introduced a bug - we shouldn't return the path if the go binary doesn't exist. TODO: This function got complicated over time and deserves proper testing. For #971 Fixes #1065 Change-Id: I3ddf90983a1f66d6d76a3f9a50eb528a93904f3c Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/279727 Trust: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> (cherry picked from commit dd9c54f) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/280592 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent 4ddeb55 commit 4763006

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/pathUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export function getBinPathWithPreferredGopathGorootWithExplanation(
104104
for (const p of defaultPathsForGo) {
105105
if (executableFileExists(p)) {
106106
binPathCache[toolName] = p;
107+
return {binPath: p, why: 'default'};
107108
}
108-
return {binPath: p, why: 'default'};
109109
}
110110
return {binPath: ''};
111111
}

0 commit comments

Comments
 (0)