Skip to content

Commit a87c062

Browse files
committed
src/goTools: install staticcheck@v0.2.2 when using go1.16 or older
This is tested in test/integration/install.test.ts "Install all tools via GOPROXY" test. Fixes #2162 Change-Id: Ie69264cc61977b12bdd41298e1164d6d5adca41f Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/400363 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
1 parent 3549a9a commit a87c062

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/goTools.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ export function getImportPathWithVersion(
8686
return importPath + '@' + version;
8787
}
8888
}
89+
// staticcheck requires go1.17+ after v0.3.0.
90+
// (golang/vscode-go#2162)
91+
if (goVersion.lt('1.17') && tool.name === 'staticcheck') {
92+
return importPath + '@v0.2.2';
93+
}
8994
return importPath + '@latest';
9095
}
9196

0 commit comments

Comments
 (0)