commit | dd9c54fa42eeeed478a112d5c26ac4bdaf4d7501 | [log] [tgz] |
---|---|---|
author | Hana <hyangah@gmail.com> | Fri Dec 25 20:02:19 2020 -0500 |
committer | Hyang-Ah Hana Kim <hyangah@gmail.com> | Mon Dec 28 15:12:19 2020 +0000 |
tree | 4f5bddad5ccdbc37dc5695a4dd14154e8b9be91d | |
parent | 0abde47644ce80e823cebc6e68bac7ba15b49af9 [diff] |
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 golang/vscode-go#971 Fixes golang/vscode-go#1065 Change-Id: I3ddf90983a1f66d6d76a3f9a50eb528a93904f3c Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/279727 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
diff --git a/src/utils/pathUtils.ts b/src/utils/pathUtils.ts index 235ca8b..0f693cb 100644 --- a/src/utils/pathUtils.ts +++ b/src/utils/pathUtils.ts
@@ -104,8 +104,8 @@ for (const p of defaultPathsForGo) { if (executableFileExists(p)) { binPathCache[toolName] = p; + return {binPath: p, why: 'default'}; } - return {binPath: p, why: 'default'}; } return {binPath: ''}; }