Skip to content

Commit dfdd910

Browse files
committed
[release] src/goInstallTools.ts: return a rejected promise when go isn't found
If Go is not found, return a rejected promise, so, the promise chaining can work. updateGoVarsFromConfig is not declared as an async, so returning nothing means returning nothing. Fixes #660 Change-Id: I16f73ca057f3b6bb220a754afc1baa43cc891c22 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/255963 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Suzy Mueller <[email protected]> (cherry picked from commit 8e9cae7) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/257603
1 parent 292b78f commit dfdd910

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/goInstallTools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export function updateGoVarsFromConfig(): Promise<void> {
347347
const goRuntimePath = getBinPath('go', false);
348348
if (!goRuntimePath) {
349349
suggestDownloadGo();
350-
return;
350+
return Promise.reject();
351351
}
352352

353353
return new Promise<void>((resolve, reject) => {
@@ -482,7 +482,7 @@ async function suggestDownloadGo() {
482482
}
483483

484484
const choice = await vscode.window.showErrorMessage(
485-
`Failed to find the "go" binary in either GOROOT(${getCurrentGoRoot()}) or PATH(${envPath}. ` +
485+
`Failed to find the "go" binary in either GOROOT(${getCurrentGoRoot()}) or PATH(${envPath}). ` +
486486
`Check PATH, or Install Go and reload the window.`,
487487
'Go to Download Page'
488488
);

0 commit comments

Comments
 (0)