Skip to content

Commit ec9e90d

Browse files
hyangahgopherbot
authored andcommitted
src/goToolsInformation: set min go version for golangci-lint
The latest golangci-lint requires go1.20+ Change-Id: Ia5d30b60f34e06b7c65668612d585ff31be48719 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/549247 Commit-Queue: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Auto-Submit: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 34f54ac commit ec9e90d

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/goToolsInformation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export const allToolsInformation: { [key: string]: Tool } = {
8383
modulePath: 'github.com/golangci/golangci-lint',
8484
replacedByGopls: false,
8585
isImportant: true,
86-
description: 'Linter'
86+
description: 'Linter',
87+
minimumGoVersion: semver.coerce('1.20')
8788
},
8889
'revive': {
8990
name: 'revive',

test/integration/install.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,17 @@ suite('Installation Tests', function () {
225225
if (!shouldRunSlowTests()) {
226226
return;
227227
}
228-
const tools = Object.keys(allToolsInformation).map((tool) => {
229-
return { name: tool };
228+
const goVersion = await getGoVersion();
229+
const tools = Object.keys(allToolsInformation).filter((tool) => {
230+
const minGoVersion = allToolsInformation[tool].minimumGoVersion;
231+
return !minGoVersion || goVersion.gt(minGoVersion.format());
230232
});
231-
await runTest(tools);
233+
assert(tools.includes('gopls') && tools.includes('dlv'), `selected tools ${JSON.stringify(tools)}`);
234+
await runTest(
235+
tools.map((tool) => {
236+
return { name: tool };
237+
})
238+
);
232239
});
233240
});
234241

tools/allTools.ts.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ export const allToolsInformation: { [key: string]: Tool } = {
8181
modulePath: 'github.com/golangci/golangci-lint',
8282
replacedByGopls: false,
8383
isImportant: true,
84-
description: 'Linter'
84+
description: 'Linter',
85+
minimumGoVersion: semver.coerce('1.20')
8586
},
8687
'revive': {
8788
name: 'revive',

0 commit comments

Comments
 (0)