Skip to content

Commit f22b65a

Browse files
committed
src/goLint: fix type error caused by a bug in goLint
When gopls's staticcheck is used, the check fails with a type error. workbench.desktop.main.js:2247 TypeError: Cannot read property 'then' of undefined at Object.check (/Users/hakim/.vscode-insiders/extensions/golang.go-0.25.0/dist/goMain.js:58418) at runBuilds (/Users/hakim/.vscode-insiders/extensions/golang.go-0.25.0/dist/goMain.js:64847) ... Callers of goLint expect Promise<ICheckResult[]>, so return a resolved promise in case we want to skip linting. Change-Id: I41c92ca9f6f6a9b961acb7f07504fbd20135fcad Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/321471 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent b6a3630 commit f22b65a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/goLint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function goLint(
6161
): Promise<ICheckResult[]> {
6262
const lintTool = goConfig['lintTool'] || 'staticcheck';
6363
if (lintTool === 'staticcheck' && goplsStaticcheckEnabled(goConfig, goplsConfig)) {
64-
return;
64+
return Promise.resolve([]);
6565
}
6666

6767
epoch++;

0 commit comments

Comments
 (0)