diff --git a/extension/src/goInstallTools.ts b/extension/src/goInstallTools.ts
index b6d039f..9f93fec 100644
--- a/extension/src/goInstallTools.ts
+++ b/extension/src/goInstallTools.ts
@@ -109,7 +109,8 @@
return;
}
await installTools(
- selected.map((x) => getTool(x.label)),
+ // Selected tools must be tool that defined in allToolsInformation.
+ selected.map((x) => getTool(x.label)!),
goVersion
);
}
@@ -376,8 +377,13 @@
await execFile(goBinary, ['install', '-v', importPath], opts);
}
-export function declinedToolInstall(toolName: string) {
+export function declinedToolInstall(toolName: string): boolean {
const tool = getTool(toolName);
+ if (!tool) {
+ // Tool that extension doesnt recoganize will not be prompt for
+ // installation and will not be declined for installation.
+ return false;
+ }
// If user has declined to install this tool, don't prompt for it.
return !!containsTool(declinedInstalls, tool);
@@ -989,7 +995,7 @@
const env = toolInstallationEnvironment();
env['GOBIN'] = path.dirname(progPath);
- const importPath = allToolsInformation['vscgo'].importPath;
+ const importPath = allToolsInformation.get('vscgo')!.importPath;
const version =
extensionMode !== vscode.ExtensionMode.Production
? ''
diff --git a/extension/src/goStatus.ts b/extension/src/goStatus.ts
index d7a0809..b7d875e 100644
--- a/extension/src/goStatus.ts
+++ b/extension/src/goStatus.ts
@@ -112,7 +112,7 @@
}
break;
case 'Install Go Language Server':
- vscode.commands.executeCommand('go.tools.install', [allToolsInformation['gopls']]);
+ vscode.commands.executeCommand('go.tools.install', [allToolsInformation.get('gopls')!]);
break;
case "Open 'go.work'":
case "Open 'go.mod'":
diff --git a/extension/src/goTools.ts b/extension/src/goTools.ts
index c4d1b70..81b8c8b 100644
--- a/extension/src/goTools.ts
+++ b/extension/src/goTools.ts
@@ -95,13 +95,13 @@
return tools.some((tool) => tool.name === toolName);
}
-export function getTool(name: string): Tool {
+export function getTool(name: string): Tool | undefined {
const [n] = name.split('@');
- return allToolsInformation[n];
+ return allToolsInformation.get(n);
}
export function getToolAtVersion(name: string, version?: semver.SemVer): ToolAtVersion {
- return { ...allToolsInformation[name], version };
+ return { ...allToolsInformation.get(name)!, version };
}
// hasModSuffix returns true if the given tool has a different, module-specific
@@ -119,7 +119,7 @@
const tools: Tool[] = [];
function maybeAddTool(name: string) {
- const tool = allToolsInformation[name];
+ const tool = allToolsInformation.get(name);
if (tool) {
if (!useLanguageServer || !tool.replacedByGopls) {
tools.push(tool);
diff --git a/extension/src/goToolsInformation.ts b/extension/src/goToolsInformation.ts
index 4b3278b..7b1857c 100644
--- a/extension/src/goToolsInformation.ts
+++ b/extension/src/goToolsInformation.ts
@@ -4,134 +4,178 @@
import semver = require('semver');
import { Tool } from './goTools';
-export const allToolsInformation: { [key: string]: Tool } = {
- 'gomodifytags': {
- name: 'gomodifytags',
- importPath: 'github.com/fatih/gomodifytags',
- modulePath: 'github.com/fatih/gomodifytags',
- replacedByGopls: true,
- isImportant: false,
- description: 'Modify tags on structs',
- defaultVersion: 'v1.17.0'
- },
- 'goplay': {
- name: 'goplay',
- importPath: 'github.com/haya14busa/goplay/cmd/goplay',
- modulePath: 'github.com/haya14busa/goplay',
- replacedByGopls: false,
- isImportant: false,
- description: 'The Go playground',
- defaultVersion: 'v1.0.0'
- },
- 'impl': {
- name: 'impl',
- importPath: 'github.com/josharian/impl',
- modulePath: 'github.com/josharian/impl',
- replacedByGopls: false,
- isImportant: false,
- description: 'Stubs for interfaces',
- defaultVersion: 'v1.4.0'
- },
- 'gofumpt': {
- name: 'gofumpt',
- importPath: 'mvdan.cc/gofumpt',
- modulePath: 'mvdan.cc/gofumpt',
- replacedByGopls: true,
- isImportant: false,
- description: 'Formatter',
- defaultVersion: 'v0.7.0'
- },
- 'goimports': {
- name: 'goimports',
- importPath: 'golang.org/x/tools/cmd/goimports',
- modulePath: 'golang.org/x/tools',
- replacedByGopls: true,
- isImportant: true,
- description: 'Formatter'
- },
- 'gotests': {
- name: 'gotests',
- importPath: 'github.com/cweill/gotests/gotests',
- modulePath: 'github.com/cweill/gotests',
- replacedByGopls: false,
- isImportant: false,
- description: 'Generate unit tests',
- minimumGoVersion: semver.coerce('1.9'),
- defaultVersion: 'v1.6.0'
- },
- 'golint': {
- name: 'golint',
- importPath: 'golang.org/x/lint/golint',
- modulePath: 'golang.org/x/lint',
- replacedByGopls: false,
- isImportant: false,
- description: 'Linter',
- minimumGoVersion: semver.coerce('1.9')
- },
- 'staticcheck': {
- name: 'staticcheck',
- importPath: 'honnef.co/go/tools/cmd/staticcheck',
- modulePath: 'honnef.co/go/tools',
- replacedByGopls: false,
- isImportant: true,
- description: 'Linter'
- },
- 'golangci-lint': {
- name: 'golangci-lint',
- importPath: 'github.com/golangci/golangci-lint/cmd/golangci-lint',
- modulePath: 'github.com/golangci/golangci-lint',
- replacedByGopls: false,
- isImportant: true,
- description: 'Linter',
- minimumGoVersion: semver.coerce('1.20')
- },
- 'golangci-lint-v2': {
- name: 'golangci-lint-v2',
- importPath: 'github.com/golangci/golangci-lint/v2/cmd/golangci-lint',
- modulePath: 'github.com/golangci/golangci-lint/v2',
- replacedByGopls: false,
- isImportant: true,
- description: 'Linter',
- minimumGoVersion: semver.coerce('1.23')
- },
- 'revive': {
- name: 'revive',
- importPath: 'github.com/mgechev/revive',
- modulePath: 'github.com/mgechev/revive',
- isImportant: true,
- description: 'Linter',
- defaultVersion: 'v1.3.9'
- },
- 'gopls': {
- name: 'gopls',
- importPath: 'golang.org/x/tools/gopls',
- modulePath: 'golang.org/x/tools/gopls',
- replacedByGopls: false, // lol
- isImportant: true,
- description: 'Language Server from Google',
- usePrereleaseInPreviewMode: true,
- minimumGoVersion: semver.coerce('1.19'),
- latestVersion: semver.parse('v0.20.0'),
- latestVersionTimestamp: moment('2025-07-28', 'YYYY-MM-DD')
- },
- 'dlv': {
- name: 'dlv',
- importPath: 'github.com/go-delve/delve/cmd/dlv',
- modulePath: 'github.com/go-delve/delve',
- replacedByGopls: false,
- isImportant: false,
- description: 'Go debugger (Delve)',
- latestVersion: semver.parse('v1.8.3'),
- latestVersionTimestamp: moment('2022-04-26', 'YYYY-MM-DD'),
- minimumGoVersion: semver.coerce('1.18')
- },
- 'vscgo': {
- name: 'vscgo',
- importPath: 'github.com/golang/vscode-go/vscgo',
- modulePath: 'github.com/golang/vscode-go/vscgo',
- replacedByGopls: false,
- isImportant: false, // TODO: set to true when we need it
- description: 'VS Code Go helper program',
- minimumGoVersion: semver.coerce('1.18')
- }
-};
+const internal = new Map<string, Tool>([
+ [
+ 'gomodifytags',
+ {
+ name: 'gomodifytags',
+ importPath: 'github.com/fatih/gomodifytags',
+ modulePath: 'github.com/fatih/gomodifytags',
+ replacedByGopls: true,
+ isImportant: false,
+ description: 'Modify tags on structs',
+ defaultVersion: 'v1.17.0'
+ }
+ ],
+ [
+ 'goplay',
+ {
+ name: 'goplay',
+ importPath: 'github.com/haya14busa/goplay/cmd/goplay',
+ modulePath: 'github.com/haya14busa/goplay',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'The Go playground',
+ defaultVersion: 'v1.0.0'
+ }
+ ],
+ [
+ 'impl',
+ {
+ name: 'impl',
+ importPath: 'github.com/josharian/impl',
+ modulePath: 'github.com/josharian/impl',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Stubs for interfaces',
+ defaultVersion: 'v1.4.0'
+ }
+ ],
+ [
+ 'gofumpt',
+ {
+ name: 'gofumpt',
+ importPath: 'mvdan.cc/gofumpt',
+ modulePath: 'mvdan.cc/gofumpt',
+ replacedByGopls: true,
+ isImportant: false,
+ description: 'Formatter',
+ defaultVersion: 'v0.7.0'
+ }
+ ],
+ [
+ 'goimports',
+ {
+ name: 'goimports',
+ importPath: 'golang.org/x/tools/cmd/goimports',
+ modulePath: 'golang.org/x/tools',
+ replacedByGopls: true,
+ isImportant: true,
+ description: 'Formatter'
+ }
+ ],
+ [
+ 'gotests',
+ {
+ name: 'gotests',
+ importPath: 'github.com/cweill/gotests/gotests',
+ modulePath: 'github.com/cweill/gotests',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Generate unit tests',
+ minimumGoVersion: semver.coerce('1.9'),
+ defaultVersion: 'v1.6.0'
+ }
+ ],
+ [
+ 'golint',
+ {
+ name: 'golint',
+ importPath: 'golang.org/x/lint/golint',
+ modulePath: 'golang.org/x/lint',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Linter',
+ minimumGoVersion: semver.coerce('1.9')
+ }
+ ],
+ [
+ 'staticcheck',
+ {
+ name: 'staticcheck',
+ importPath: 'honnef.co/go/tools/cmd/staticcheck',
+ modulePath: 'honnef.co/go/tools',
+ replacedByGopls: false,
+ isImportant: true,
+ description: 'Linter'
+ }
+ ],
+ [
+ 'golangci-lint',
+ {
+ name: 'golangci-lint',
+ importPath: 'github.com/golangci/golangci-lint/cmd/golangci-lint',
+ modulePath: 'github.com/golangci/golangci-lint',
+ replacedByGopls: false,
+ isImportant: true,
+ description: 'Linter',
+ minimumGoVersion: semver.coerce('1.20')
+ }
+ ],
+ [
+ 'golangci-lint-v2',
+ {
+ name: 'golangci-lint-v2',
+ importPath: 'github.com/golangci/golangci-lint/v2/cmd/golangci-lint',
+ modulePath: 'github.com/golangci/golangci-lint/v2',
+ replacedByGopls: false,
+ isImportant: true,
+ description: 'Linter',
+ minimumGoVersion: semver.coerce('1.23')
+ }
+ ],
+ [
+ 'revive',
+ {
+ name: 'revive',
+ importPath: 'github.com/mgechev/revive',
+ modulePath: 'github.com/mgechev/revive',
+ isImportant: true,
+ description: 'Linter',
+ defaultVersion: 'v1.3.9'
+ }
+ ],
+ [
+ 'gopls',
+ {
+ name: 'gopls',
+ importPath: 'golang.org/x/tools/gopls',
+ modulePath: 'golang.org/x/tools/gopls',
+ replacedByGopls: false, // lol
+ isImportant: true,
+ description: 'Language Server from Google',
+ usePrereleaseInPreviewMode: true,
+ minimumGoVersion: semver.coerce('1.19'),
+ latestVersion: semver.parse('v0.20.0'),
+ latestVersionTimestamp: moment('2025-07-28', 'YYYY-MM-DD')
+ }
+ ],
+ [
+ 'dlv',
+ {
+ name: 'dlv',
+ importPath: 'github.com/go-delve/delve/cmd/dlv',
+ modulePath: 'github.com/go-delve/delve',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Go debugger (Delve)',
+ latestVersion: semver.parse('v1.8.3'),
+ latestVersionTimestamp: moment('2022-04-26', 'YYYY-MM-DD'),
+ minimumGoVersion: semver.coerce('1.18')
+ }
+ ],
+ [
+ 'vscgo',
+ {
+ name: 'vscgo',
+ importPath: 'github.com/golang/vscode-go/vscgo',
+ modulePath: 'github.com/golang/vscode-go/vscgo',
+ replacedByGopls: false,
+ isImportant: false, // TODO: set to true when we need it
+ description: 'VS Code Go helper program',
+ minimumGoVersion: semver.coerce('1.18')
+ }
+ ]
+]);
+
+export const allToolsInformation: ReadonlyMap<string, Tool> = internal;
diff --git a/extension/src/language/goLanguageServer.ts b/extension/src/language/goLanguageServer.ts
index f801daa..73e234c 100644
--- a/extension/src/language/goLanguageServer.ts
+++ b/extension/src/language/goLanguageServer.ts
@@ -161,7 +161,7 @@
return vscode.workspace.textDocuments.some((doc) => doc.languageId === 'go');
};
const installGopls = async (cfg: LanguageServerConfig) => {
- const tool = getTool('gopls');
+ const tool: Tool = getTool('gopls')!;
const versionToUpdate = await shouldUpdateLanguageServer(tool, cfg);
if (!versionToUpdate) {
return;
@@ -1402,13 +1402,11 @@
// The user may have an outdated version of gopls, in which case we should
// just prompt them to update.
- const tool = getTool('gopls');
- if (tool) {
- const versionToUpdate = await shouldUpdateLanguageServer(tool, goCtx.latestConfig, true);
- if (versionToUpdate) {
- promptForUpdatingTool(tool.name, versionToUpdate, true);
- return;
- }
+ const tool: Tool = getTool('gopls')!;
+ const versionToUpdate = await shouldUpdateLanguageServer(tool, goCtx.latestConfig, true);
+ if (versionToUpdate) {
+ promptForUpdatingTool(tool.name, versionToUpdate, true);
+ return;
}
// Show the user the output channel content to alert them to the issue.
diff --git a/extension/test/gopls/update.test.ts b/extension/test/gopls/update.test.ts
index a407ef5..d7f825f 100644
--- a/extension/test/gopls/update.test.ts
+++ b/extension/test/gopls/update.test.ts
@@ -17,7 +17,7 @@
import sinon = require('sinon');
suite('gopls okForStagedRollout', () => {
- const tool = getTool('gopls');
+ const tool: Tool = getTool('gopls')!;
const sandbox = sinon.createSandbox();
teardown(() => {
sandbox.restore();
@@ -53,7 +53,7 @@
suite('gopls update tests', () => {
test('prompt for update', async () => {
- const tool = getTool('gopls');
+ const tool: Tool = getTool('gopls')!;
const toSemver = (v: string) => semver.parse(v, { includePrerelease: true, loose: true });
@@ -131,7 +131,7 @@
});
suite('version comparison', () => {
- const tool = getTool('dlv');
+ const tool: Tool = getTool('dlv')!;
const latestVersion = tool.latestVersion;
teardown(() => {
diff --git a/extension/test/integration/install.test.ts b/extension/test/integration/install.test.ts
index d0bee9f..1f06a2e 100644
--- a/extension/test/integration/install.test.ts
+++ b/extension/test/integration/install.test.ts
@@ -234,7 +234,7 @@
assert(failures?.length === 1 && failures[0].tool.name === 'gopls' && failures[0].reason.includes('or newer'));
});
- const gofumptDefault = allToolsInformation['gofumpt'].defaultVersion!;
+ const gofumptDefault = allToolsInformation.get('gofumpt')!.defaultVersion!;
test('Install gofumpt with old go', async () => {
await runTest(
[{ name: 'gofumpt', versions: ['v0.5.0', 'v0.6.0', gofumptDefault], wantVersion: 'v0.6.0' }],
@@ -285,10 +285,14 @@
return;
}
const goVersion = await getGoVersion();
- const tools = Object.keys(allToolsInformation).filter((tool) => {
- const minGoVersion = allToolsInformation[tool].minimumGoVersion;
- return !minGoVersion || goVersion.gt(minGoVersion.format());
- });
+
+ const tools: string[] = [];
+ for (const [name, info] of allToolsInformation) {
+ const minGoVersion = info.minimumGoVersion;
+ if (!minGoVersion || goVersion.gt(minGoVersion.format())) {
+ tools.push(name);
+ }
+ }
assert(tools.includes('gopls') && tools.includes('dlv'), `selected tools ${JSON.stringify(tools)}`);
await runTest(
tools.map((tool) => {
@@ -303,7 +307,7 @@
function buildFakeProxy(testCases: installationTestCase[]) {
const proxyDir = fs.mkdtempSync(path.join(os.tmpdir(), 'proxydir'));
for (const tc of testCases) {
- const tool = getTool(tc.name);
+ const tool: Tool = getTool(tc.name)!;
const module = tool.modulePath;
const pathInModule =
tool.modulePath === tool.importPath ? '' : tool.importPath.slice(tool.modulePath.length + 1) + '/';
diff --git a/extension/tools/allTools.ts.in b/extension/tools/allTools.ts.in
index 186ecdd..bf5b00c 100644
--- a/extension/tools/allTools.ts.in
+++ b/extension/tools/allTools.ts.in
@@ -2,134 +2,178 @@
import semver = require('semver');
import { Tool } from './goTools';
-export const allToolsInformation: { [key: string]: Tool } = {
- 'gomodifytags': {
- name: 'gomodifytags',
- importPath: 'github.com/fatih/gomodifytags',
- modulePath: 'github.com/fatih/gomodifytags',
- replacedByGopls: true,
- isImportant: false,
- description: 'Modify tags on structs',
- defaultVersion: 'v1.17.0'
- },
- 'goplay': {
- name: 'goplay',
- importPath: 'github.com/haya14busa/goplay/cmd/goplay',
- modulePath: 'github.com/haya14busa/goplay',
- replacedByGopls: false,
- isImportant: false,
- description: 'The Go playground',
- defaultVersion: 'v1.0.0'
- },
- 'impl': {
- name: 'impl',
- importPath: 'github.com/josharian/impl',
- modulePath: 'github.com/josharian/impl',
- replacedByGopls: false,
- isImportant: false,
- description: 'Stubs for interfaces',
- defaultVersion: 'v1.4.0'
- },
- 'gofumpt': {
- name: 'gofumpt',
- importPath: 'mvdan.cc/gofumpt',
- modulePath: 'mvdan.cc/gofumpt',
- replacedByGopls: true,
- isImportant: false,
- description: 'Formatter',
- defaultVersion: 'v0.7.0'
- },
- 'goimports': {
- name: 'goimports',
- importPath: 'golang.org/x/tools/cmd/goimports',
- modulePath: 'golang.org/x/tools',
- replacedByGopls: true,
- isImportant: true,
- description: 'Formatter'
- },
- 'gotests': {
- name: 'gotests',
- importPath: 'github.com/cweill/gotests/gotests',
- modulePath: 'github.com/cweill/gotests',
- replacedByGopls: false,
- isImportant: false,
- description: 'Generate unit tests',
- minimumGoVersion: semver.coerce('1.9'),
- defaultVersion: 'v1.6.0'
- },
- 'golint': {
- name: 'golint',
- importPath: 'golang.org/x/lint/golint',
- modulePath: 'golang.org/x/lint',
- replacedByGopls: false,
- isImportant: false,
- description: 'Linter',
- minimumGoVersion: semver.coerce('1.9')
- },
- 'staticcheck': {
- name: 'staticcheck',
- importPath: 'honnef.co/go/tools/cmd/staticcheck',
- modulePath: 'honnef.co/go/tools',
- replacedByGopls: false,
- isImportant: true,
- description: 'Linter'
- },
- 'golangci-lint': {
- name: 'golangci-lint',
- importPath: 'github.com/golangci/golangci-lint/cmd/golangci-lint',
- modulePath: 'github.com/golangci/golangci-lint',
- replacedByGopls: false,
- isImportant: true,
- description: 'Linter',
- minimumGoVersion: semver.coerce('1.20')
- },
- 'golangci-lint-v2': {
- name: 'golangci-lint-v2',
- importPath: 'github.com/golangci/golangci-lint/v2/cmd/golangci-lint',
- modulePath: 'github.com/golangci/golangci-lint/v2',
- replacedByGopls: false,
- isImportant: true,
- description: 'Linter',
- minimumGoVersion: semver.coerce('1.23')
- },
- 'revive': {
- name: 'revive',
- importPath: 'github.com/mgechev/revive',
- modulePath: 'github.com/mgechev/revive',
- isImportant: true,
- description: 'Linter',
- defaultVersion: 'v1.3.9'
- },
- 'gopls': {
- name: 'gopls',
- importPath: 'golang.org/x/tools/gopls',
- modulePath: 'golang.org/x/tools/gopls',
- replacedByGopls: false, // lol
- isImportant: true,
- description: 'Language Server from Google',
- usePrereleaseInPreviewMode: true,
- minimumGoVersion: semver.coerce('1.19'),
- latestVersion: semver.parse('%s'),
- latestVersionTimestamp: moment('%s', 'YYYY-MM-DD')
- },
- 'dlv': {
- name: 'dlv',
- importPath: 'github.com/go-delve/delve/cmd/dlv',
- modulePath: 'github.com/go-delve/delve',
- replacedByGopls: false,
- isImportant: false,
- description: 'Go debugger (Delve)',
- latestVersion: semver.parse('v1.8.3'),
- latestVersionTimestamp: moment('2022-04-26', 'YYYY-MM-DD'),
- minimumGoVersion: semver.coerce('1.18')
- },
- 'vscgo': {
- name: 'vscgo',
- importPath: 'github.com/golang/vscode-go/vscgo',
- modulePath: 'github.com/golang/vscode-go/vscgo',
- replacedByGopls: false,
- isImportant: false, // TODO: set to true when we need it
- description: 'VS Code Go helper program',
- minimumGoVersion: semver.coerce('1.18')
- }
-};
\ No newline at end of file
+const internal = new Map<string, Tool>([
+ [
+ 'gomodifytags',
+ {
+ name: 'gomodifytags',
+ importPath: 'github.com/fatih/gomodifytags',
+ modulePath: 'github.com/fatih/gomodifytags',
+ replacedByGopls: true,
+ isImportant: false,
+ description: 'Modify tags on structs',
+ defaultVersion: 'v1.17.0'
+ }
+ ],
+ [
+ 'goplay',
+ {
+ name: 'goplay',
+ importPath: 'github.com/haya14busa/goplay/cmd/goplay',
+ modulePath: 'github.com/haya14busa/goplay',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'The Go playground',
+ defaultVersion: 'v1.0.0'
+ }
+ ],
+ [
+ 'impl',
+ {
+ name: 'impl',
+ importPath: 'github.com/josharian/impl',
+ modulePath: 'github.com/josharian/impl',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Stubs for interfaces',
+ defaultVersion: 'v1.4.0'
+ }
+ ],
+ [
+ 'gofumpt',
+ {
+ name: 'gofumpt',
+ importPath: 'mvdan.cc/gofumpt',
+ modulePath: 'mvdan.cc/gofumpt',
+ replacedByGopls: true,
+ isImportant: false,
+ description: 'Formatter',
+ defaultVersion: 'v0.7.0'
+ }
+ ],
+ [
+ 'goimports',
+ {
+ name: 'goimports',
+ importPath: 'golang.org/x/tools/cmd/goimports',
+ modulePath: 'golang.org/x/tools',
+ replacedByGopls: true,
+ isImportant: true,
+ description: 'Formatter'
+ }
+ ],
+ [
+ 'gotests',
+ {
+ name: 'gotests',
+ importPath: 'github.com/cweill/gotests/gotests',
+ modulePath: 'github.com/cweill/gotests',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Generate unit tests',
+ minimumGoVersion: semver.coerce('1.9'),
+ defaultVersion: 'v1.6.0'
+ }
+ ],
+ [
+ 'golint',
+ {
+ name: 'golint',
+ importPath: 'golang.org/x/lint/golint',
+ modulePath: 'golang.org/x/lint',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Linter',
+ minimumGoVersion: semver.coerce('1.9')
+ }
+ ],
+ [
+ 'staticcheck',
+ {
+ name: 'staticcheck',
+ importPath: 'honnef.co/go/tools/cmd/staticcheck',
+ modulePath: 'honnef.co/go/tools',
+ replacedByGopls: false,
+ isImportant: true,
+ description: 'Linter'
+ }
+ ],
+ [
+ 'golangci-lint',
+ {
+ name: 'golangci-lint',
+ importPath: 'github.com/golangci/golangci-lint/cmd/golangci-lint',
+ modulePath: 'github.com/golangci/golangci-lint',
+ replacedByGopls: false,
+ isImportant: true,
+ description: 'Linter',
+ minimumGoVersion: semver.coerce('1.20')
+ }
+ ],
+ [
+ 'golangci-lint-v2',
+ {
+ name: 'golangci-lint-v2',
+ importPath: 'github.com/golangci/golangci-lint/v2/cmd/golangci-lint',
+ modulePath: 'github.com/golangci/golangci-lint/v2',
+ replacedByGopls: false,
+ isImportant: true,
+ description: 'Linter',
+ minimumGoVersion: semver.coerce('1.23')
+ }
+ ],
+ [
+ 'revive',
+ {
+ name: 'revive',
+ importPath: 'github.com/mgechev/revive',
+ modulePath: 'github.com/mgechev/revive',
+ isImportant: true,
+ description: 'Linter',
+ defaultVersion: 'v1.3.9'
+ }
+ ],
+ [
+ 'gopls',
+ {
+ name: 'gopls',
+ importPath: 'golang.org/x/tools/gopls',
+ modulePath: 'golang.org/x/tools/gopls',
+ replacedByGopls: false, // lol
+ isImportant: true,
+ description: 'Language Server from Google',
+ usePrereleaseInPreviewMode: true,
+ minimumGoVersion: semver.coerce('1.19'),
+ latestVersion: semver.parse('v0.20.0'),
+ latestVersionTimestamp: moment('2025-07-28', 'YYYY-MM-DD')
+ }
+ ],
+ [
+ 'dlv',
+ {
+ name: 'dlv',
+ importPath: 'github.com/go-delve/delve/cmd/dlv',
+ modulePath: 'github.com/go-delve/delve',
+ replacedByGopls: false,
+ isImportant: false,
+ description: 'Go debugger (Delve)',
+ latestVersion: semver.parse('v1.8.3'),
+ latestVersionTimestamp: moment('2022-04-26', 'YYYY-MM-DD'),
+ minimumGoVersion: semver.coerce('1.18')
+ }
+ ],
+ [
+ 'vscgo',
+ {
+ name: 'vscgo',
+ importPath: 'github.com/golang/vscode-go/vscgo',
+ modulePath: 'github.com/golang/vscode-go/vscgo',
+ replacedByGopls: false,
+ isImportant: false, // TODO: set to true when we need it
+ description: 'VS Code Go helper program',
+ minimumGoVersion: semver.coerce('1.18')
+ }
+ ]
+]);
+
+export const allToolsInformation: ReadonlyMap<string, Tool> = internal;