Hyang-Ah Hana Kim has uploaded this change for review.
src/goLint: switch the default lint tool to staticcheck
Golint is unmaintained and effectively deprecated.
So, switch to staticcheck, which is one of the existing linter
options we've provided, and is actively maintained.
Compared to golint, we observed staticcheck provides more useful
signals about the code style and common errors, while it is still
easy to use. Some controversial checks existed in the golint are
turned off by default (ST1000, ST1003, ST1016), or removed. Users
can turn them on if want, by supplying -checks as lintFlags.
Unlike golint, staticcheck reports only compile errors and does
not show other lint errors if compile errors are present - I am not
sure how much this will bother users yet. We may want to consider
turning off the compile error reports (since there is a separate build
check and also gopls will report those errors).
Errors from lint and gopls aren't currently deduplicated, that
will be addressed separately.
Fixes golang/vscode-go#189
Updates #38968
Updates golang/vscode-go#142
Change-Id: Ie9334867aef3673aed01d7eaf757966486178dbc
---
M .github/workflows/release-nightly.yml
M .github/workflows/test-long.yml
M .github/workflows/test-smoke.yml
M build/all.bash
M docs/settings.md
M docs/tools.md
M package.json
M src/goLint.ts
M src/goTools.ts
M test/integration/extension.test.ts
M test/testdata/linterTest/linter_1.go
M test/testdata/linterTest/linter_2.go
12 files changed, 40 insertions(+), 23 deletions(-)
diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml
index f232d3f..2aaf455 100644
--- a/.github/workflows/release-nightly.yml
+++ b/.github/workflows/release-nightly.yml
@@ -52,7 +52,7 @@
go get github.com/sqs/goreturns
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/zmb3/gogetdoc
- go get golang.org/x/lint/golint
+ go get honnef.co/go/tools/...
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
diff --git a/.github/workflows/test-long.yml b/.github/workflows/test-long.yml
index 4b129a0..2aca343 100644
--- a/.github/workflows/test-long.yml
+++ b/.github/workflows/test-long.yml
@@ -51,7 +51,7 @@
go get github.com/sqs/goreturns
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/zmb3/gogetdoc
- go get golang.org/x/lint/golint
+ go get honnef.co/go/tools/...
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml
index 941cfc3..fbc783f 100644
--- a/.github/workflows/test-smoke.yml
+++ b/.github/workflows/test-smoke.yml
@@ -47,7 +47,7 @@
go get github.com/sqs/goreturns
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/zmb3/gogetdoc
- go get golang.org/x/lint/golint
+ go get honnef.co/go/tools/...
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
diff --git a/build/all.bash b/build/all.bash
index afd0706..85ffdde 100755
--- a/build/all.bash
+++ b/build/all.bash
@@ -103,7 +103,7 @@
GO111MODULE=on go get github.com/sqs/goreturns
GO111MODULE=on go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
GO111MODULE=on go get github.com/zmb3/gogetdoc
- GO111MODULE=on go get golang.org/x/lint/golint
+ GO111MODULE=on go get honnef.co/go/tools/...
GO111MODULE=on go get golang.org/x/tools/cmd/gorename
GO111MODULE=on go get github.com/go-delve/delve/cmd/dlv
}
diff --git a/docs/settings.md b/docs/settings.md
index 80cf4bf..4ce7b95 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -398,7 +398,7 @@
Allowed Values:`[golint golangci-lint revive staticcheck]`
-Default: `golint`
+Default: `staticcheck`
### `go.liveErrors`
diff --git a/docs/tools.md b/docs/tools.md
index 8a620aa..c91d567 100644
--- a/docs/tools.md
+++ b/docs/tools.md
@@ -150,11 +150,12 @@
The command used to provide build errors on-save is `go build -i -o` or `go test -i -c -o` (for test files). The binary generated by the build is written to a temporary location.
-Other lint tools can be used instead of [`golint`] by configuring the [`"go.lintTool"`](settings.md#go.lintTool) setting. Other options include:
+Other lint tools can be used instead of [`staticcheck`] by configuring the [`"go.lintTool"`](settings.md#go.lintTool) setting. Other options include:
-* [`staticcheck`]: This tool provides a great deal of useful checks that are not provided by [`golint`]. See the full list at [staticcheck.io/docs/checks](https://staticcheck.io/docs/checks). It is also officially supported by the [Go team at Google](https://staticcheck.io/sponsors).
+* [`staticcheck`]: See the full list at [staticcheck.io/docs/checks](https://staticcheck.io/docs/checks). It is also officially supported by the [Go team at Google](https://staticcheck.io/sponsors).
* [`golangci-lint`]: This tool combines a number of existing lint tools, including [staticcheck](#staticcheck), into one interface.
* [`revive`]: This tool is an enhancement on top of [`golint`], and it provides additional checks.
+* [`golint`]: This tool has been a traditional lint tool, but is about to get deprecated. See the [deprecation proposal](https://github.com/golang/go/issues/38968).
You can use the [`"go.lintFlags"`](settings.md#go.lintFlags) setting to further configure your linter of choice. Most linters can be configured via special configuration files, but you may still need to pass these command-line flags. The configuration documentation for each supported linter is listed here:
diff --git a/package.json b/package.json
index bd1e5ef..bdfaf54 100644
--- a/package.json
+++ b/package.json
@@ -1260,7 +1260,7 @@
},
"go.lintTool": {
"type": "string",
- "default": "golint",
+ "default": "staticcheck",
"description": "Specifies Lint tool name.",
"scope": "resource",
"enum": [
diff --git a/src/goLint.ts b/src/goLint.ts
index 0e8abfb..ebf8e54 100644
--- a/src/goLint.ts
+++ b/src/goLint.ts
@@ -81,7 +81,7 @@
return Promise.resolve([]);
}
- const lintTool = goConfig['lintTool'] || 'golint';
+ const lintTool = goConfig['lintTool'] || 'staticcheck';
const lintFlags: string[] = goConfig['lintFlags'] || [];
const lintEnv = toolExecutionEnvironment();
const args: string[] = [];
diff --git a/src/goTools.ts b/src/goTools.ts
index e9387ba..3e17123 100644
--- a/src/goTools.ts
+++ b/src/goTools.ts
@@ -343,7 +343,7 @@
name: 'golint',
importPath: 'golang.org/x/lint/golint',
replacedByGopls: false,
- isImportant: true,
+ isImportant: false,
description: 'Linter',
minimumGoVersion: semver.coerce('1.9'),
},
diff --git a/test/integration/extension.test.ts b/test/integration/extension.test.ts
index 3957b2e..6d50932 100644
--- a/test/integration/extension.test.ts
+++ b/test/integration/extension.test.ts
@@ -395,8 +395,11 @@
const file1 = await vscode.workspace.openTextDocument(vscode.Uri.file(path.join(fixturePath, 'linterTest', 'linter_1.go')));
const file2 = await vscode.workspace.openTextDocument(vscode.Uri.file(path.join(fixturePath, 'linterTest', 'linter_2.go')));
const warnings = await goLint(file2.uri, Object.create(vscode.workspace.getConfiguration('go'), {
- lintTool: { value: 'golint' },
- lintFlags: { value: [] }
+ lintTool: { value: 'staticcheck' },
+ lintFlags: { value: ['-checks', 'all,-ST1000,-ST1016'] }
+ // staticcheck skips debatable checks such as ST1003 by default,
+ // but this test depends on ST1003 (MixedCaps package name) presented in both files
+ // in the same package. So, enable that.
}), 'package');
const diagnosticCollection = vscode.languages.createDiagnosticCollection('linttest');
@@ -416,15 +419,17 @@
vetOnSave: { value: 'package' },
vetFlags: { value: ['-all'] },
lintOnSave: { value: 'package' },
- lintTool: { value: 'golint' },
+ lintTool: { value: 'staticcheck' },
lintFlags: { value: [] },
buildOnSave: { value: 'package' }
});
const expectedLintErrors = [
+ // Unlike golint, staticcheck will report only those compile errors,
+ // but not lint errors when the program is broken.
{
- line: 7,
+ line: 11,
severity: 'warning',
- msg: 'exported function Print2 should have comment or be unexported'
+ msg: 'undeclared name: prin (compile)',
},
];
// If a user has enabled diagnostics via a language server,
@@ -432,6 +437,7 @@
const lspConfig = buildLanguageServerConfig(getGoConfig());
const expectedBuildVetErrors = lspConfig.enabled ? [] : [{ line: 11, severity: 'error', msg: 'undefined: prin' }];
+ // `check` itself doesn't run deDupeDiagnostics, so we expect all vet/lint errors.
const expected = [...expectedLintErrors, ...expectedBuildVetErrors];
const diagnostics = await check(vscode.Uri.file(path.join(fixturePath, 'errorsTest', 'errors.go')), config);
const sortedDiagnostics = ([] as ICheckResult[]).concat
diff --git a/test/testdata/linterTest/linter_1.go b/test/testdata/linterTest/linter_1.go
index b76bee3..1c42905 100644
--- a/test/testdata/linterTest/linter_1.go
+++ b/test/testdata/linterTest/linter_1.go
@@ -1,12 +1,17 @@
package linterTest
-import "fmt"
+import (
+ "fmt"
+)
func ExportedFunc() {
- a := 10
- func() {
- a := 20
- }()
-
- fmt.Println("OUTER A: ", a)
+ x := compute()
+ if x == nil {
+ fmt.Println("nil pointer received")
+ }
+ // if x is nil, the next line will panic.
+ foo(*x)
}
+
+func compute() **int { return nil }
+func foo(x *int) { fmt.Println(*x) }
diff --git a/test/testdata/linterTest/linter_2.go b/test/testdata/linterTest/linter_2.go
index f58961a..33916a5 100644
--- a/test/testdata/linterTest/linter_2.go
+++ b/test/testdata/linterTest/linter_2.go
@@ -1,5 +1,10 @@
package linterTest
-func secondFunc() error {
+import (
+ "errors"
+ "fmt"
+)
+func secondFunc() error {
+ return errors.New(fmt.Sprint("Errors"))
}
To view, visit change 279212. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim.
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/ba0bab64-d122-40e4-8f71-0cfba978b272
Patch set 1:TryBot-Result -1
Attention is currently required from: Hyang-Ah Hana Kim.
Hyang-Ah Hana Kim uploaded patch set #2 to this change.
src/goLint: switch the default lint tool to staticcheck
Golint is unmaintained and effectively deprecated.
So, switch to staticcheck, which is one of the existing linter
options we've provided, and is actively maintained.
Compared to golint, we observed staticcheck provides more useful
signals about the code style and common errors, while it is still
easy to use. Some controversial checks existed in the golint are
turned off by default (ST1000, ST1003, ST1016), or removed. Users
can turn them on if want, by supplying -checks as lintFlags.
Unlike golint, staticcheck reports only compile errors and does
not show other lint errors if compile errors are present - I am not
sure how much this will bother users yet. We may want to consider
turning off the compile error reports (since there is a separate build
check and also gopls will report those errors).
Fixes golang/vscode-go#189
Updates #38968
Change-Id: Ie9334867aef3673aed01d7eaf757966486178dbc
---
M .github/workflows/release-nightly.yml
M .github/workflows/test-long-all.yml
M .github/workflows/test-long.yml
M .github/workflows/test-smoke.yml
M build/all.bash
M docs/tools.md
M src/goLint.ts
M src/goTools.ts
M test/integration/extension.test.ts
M test/testdata/linterTest/linter_1.go
M test/testdata/linterTest/linter_2.go
11 files changed, 41 insertions(+), 24 deletions(-)
To view, visit change 279212. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim.
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/4c81e752-6b39-4fa8-bf30-126549523575
Patch set 2:TryBot-Result +1
Attention is currently required from: Suzy Mueller, Hyang-Ah Hana Kim.
2 comments:
Commit Message:
We may want to consider
turning off the compile error reports (since there is a separate build
check and also gopls will report those errors).
Does the duplicate check not work on these?
File docs/tools.md:
Patch Set #2, Line 70: * [`golint`]: This used to be the default linter used by this extension before it was officially deprecated.
should we just fully remove it?
To view, visit change 279212. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Hyang-Ah Hana Kim.
1 comment:
File docs/tools.md:
Patch Set #2, Line 65: See the full list at
Maybe "See the full list of checks that staticcheck provides at"?
Unclear to me when first reading it what this link has the full list of.
To view, visit change 279212. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Suzy Mueller.
Patch set 5:Run-TryBot +1Trust +1
Attention is currently required from: Suzy Mueller.
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/1fc8a47e-92b5-45c3-abd2-1d4ac0f28ddb
Patch set 5:TryBot-Result +1
Attention is currently required from: Suzy Mueller.
1 comment:
File docs/tools.md:
delete extra space?
Done
To view, visit change 279212. To unsubscribe, or for help writing mail filters, visit settings.
Hyang-Ah Hana Kim submitted this change.
src/goLint: switch the default lint tool to staticcheck
Golint is unmaintained and effectively deprecated.
So, switch to staticcheck, which is one of the existing linter
options we've provided, and is actively maintained.
Compared to golint, we observed staticcheck provides more useful
signals about the code style and common errors, while it is still
easy to use. Some controversial checks existed in the golint are
turned off by default (ST1000, ST1003, ST1016), or removed. Users
can turn them on if want, by supplying -checks as lintFlags.
Unlike golint, staticcheck reports only compile errors and does
not show other lint errors if compile errors are present. Because
the compile errors will be also detected by the language server
or by the buildOnSave/vetOnSave checks and the extension will
deduplicate them, it may look to users as if the linter wasn't
running - I am not sure how much this will bother users yet.
Fixes golang/vscode-go#189
Updates #38968
Change-Id: Ie9334867aef3673aed01d7eaf757966486178dbc
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/279212
Trust: Hyang-Ah Hana Kim <hya...@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hya...@gmail.com>
TryBot-Result: kokoro <noreply...@google.com>
Reviewed-by: Rebecca Stambler <rsta...@golang.org>
---
M .github/workflows/release-nightly.yml
M .github/workflows/test-long-all.yml
M .github/workflows/test-long.yml
M .github/workflows/test-smoke.yml
M build/all.bash
M docs/settings.md
M docs/tools.md
M package.json
M src/goLint.ts
M src/goTools.ts
M test/integration/extension.test.ts
M test/testdata/linterTest/linter_1.go
M test/testdata/linterTest/linter_2.go
13 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml
index 0fd28c3..7341c45 100644
--- a/.github/workflows/release-nightly.yml
+++ b/.github/workflows/release-nightly.yml
@@ -57,7 +57,7 @@
go get github.com/sqs/goreturns
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/zmb3/gogetdoc
- go get golang.org/x/lint/golint
+ go get honnef.co/go/tools/...
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
diff --git a/.github/workflows/test-long-all.yml b/.github/workflows/test-long-all.yml
index a999273..6e7521b 100644
--- a/.github/workflows/test-long-all.yml
+++ b/.github/workflows/test-long-all.yml
@@ -53,7 +53,7 @@
go get github.com/sqs/goreturns
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/zmb3/gogetdoc
- go get golang.org/x/lint/golint
+ go get honnef.co/go/tools/...
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
diff --git a/.github/workflows/test-long.yml b/.github/workflows/test-long.yml
index 4d6119b..3070067 100644
--- a/.github/workflows/test-long.yml
+++ b/.github/workflows/test-long.yml
@@ -52,7 +52,7 @@
go get github.com/sqs/goreturns
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/zmb3/gogetdoc
- go get golang.org/x/lint/golint
+ go get honnef.co/go/tools/...
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
diff --git a/.github/workflows/test-smoke.yml b/.github/workflows/test-smoke.yml
index 9dcb91c..e314ecd 100644
--- a/.github/workflows/test-smoke.yml
+++ b/.github/workflows/test-smoke.yml
@@ -50,7 +50,7 @@
go get github.com/sqs/goreturns
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
go get github.com/zmb3/gogetdoc
- go get golang.org/x/lint/golint
+ go get honnef.co/go/tools/...
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
diff --git a/build/all.bash b/build/all.bash
index a13776f..fa80da7 100755
--- a/build/all.bash
+++ b/build/all.bash
@@ -115,7 +115,7 @@
GO111MODULE=on go get github.com/sqs/goreturns
GO111MODULE=on go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
GO111MODULE=on go get github.com/zmb3/gogetdoc
- GO111MODULE=on go get golang.org/x/lint/golint
+ GO111MODULE=on go get honnef.co/go/tools/...
GO111MODULE=on go get golang.org/x/tools/cmd/gorename
GO111MODULE=on go get github.com/go-delve/delve/cmd/dlv@master
}
diff --git a/docs/settings.md b/docs/settings.md
index 9f53602..36ef931 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -312,9 +312,9 @@
### `go.lintTool`
Specifies Lint tool name.<br/>
-Allowed Options: `golint`, `golangci-lint`, `revive`, `staticcheck`
+Allowed Options: `staticcheck`, `golint`, `golangci-lint`, `revive`
-Default: `"golint"`
+Default: `"staticcheck"`
### `go.liveErrors`
Use gotype on the file currently being edited and report any semantic or syntactic errors found after configured delay. Not applicable when using the language server.
diff --git a/docs/tools.md b/docs/tools.md
index fc3f9ce..2cf6201 100644
--- a/docs/tools.md
+++ b/docs/tools.md
@@ -60,13 +60,14 @@
This tool provides support for the [`Go: Generate Unit Tests`](features.md#generate-unit-tests) set of commands.
-### [`golint`]
+### [`staticcheck`]
-This is the default lint tool. Other lint tools can be used by configuring the [`"go.lintTool"`](settings.md#go.lintTool) setting. Other options include:
+This is the default lint tool. See the [full list of checks](https://staticcheck.io/docs/checks) that `staticcheck` provides. Other lint tools can be used by configuring the [`"go.lintTool"`](settings.md#go.lintTool) setting.
+Other options include:
- * [`staticcheck`]: This tool provides a great deal of useful checks that are not provided by [`golint`]. See the full list at [staticcheck.io/docs/checks](https://staticcheck.io/docs/checks). It is also officially supported by the [Go team at Google](https://staticcheck.io/sponsors).
- * [`golangci-lint`]: This tool combines a number of existing lint tools, including [staticcheck](#staticcheck), into one interface.
+ * [`golangci-lint`]: This meta-linter combines a number of existing lint tools, including [staticcheck](#staticcheck), into one interface.
* [`revive`]: This tool is an enhancement on top of [`golint`], and it provides additional checks.
+ * [`golint`]: This used to be the default linter used by this extension before it was officially deprecated.
You can use the [`"go.lintFlags"`](settings.md#go.lintFlags) setting to further configure your linter of choice. Most linters can be configured via special configuration files, but you may still need to pass these command-line flags. The configuration documentation for each supported linter is listed here:
diff --git a/package.json b/package.json
index 1f9d8e2..393fb6c 100644
--- a/package.json
+++ b/package.json
@@ -977,14 +977,14 @@
},
"go.lintTool": {
"type": "string",
- "default": "golint",
+ "default": "staticcheck",
"description": "Specifies Lint tool name.",
"scope": "resource",
"enum": [
+ "staticcheck",
"golint",
"golangci-lint",
- "revive",
- "staticcheck"
+ "revive"
]
},
"go.lintFlags": {
diff --git a/src/goLint.ts b/src/goLint.ts
index cad38de..685c644 100644
--- a/src/goLint.ts
+++ b/src/goLint.ts
@@ -9,14 +9,7 @@
import { toolExecutionEnvironment } from './goEnv';
import { lintDiagnosticCollection } from './goMain';
import { diagnosticsStatusBarItem, outputChannel } from './goStatus';
-import {
- getToolsGopath,
- getWorkspaceFolderPath,
- handleDiagnosticErrors,
- ICheckResult,
- resolvePath,
- runTool
-} from './util';
+import { getWorkspaceFolderPath, handleDiagnosticErrors, ICheckResult, resolvePath, runTool } from './util';
/**
* Runs linter on the current file, package or workspace.
*/
@@ -81,7 +74,7 @@
return Promise.resolve([]);
}
- const lintTool = goConfig['lintTool'] || 'golint';
+ const lintTool = goConfig['lintTool'] || 'staticcheck';
const lintFlags: string[] = goConfig['lintFlags'] || [];
const lintEnv = toolExecutionEnvironment();
const args: string[] = [];
@@ -102,16 +95,6 @@
}
args.push(flag);
});
- if (lintTool === 'gometalinter') {
- if (args.indexOf('--aggregate') === -1) {
- args.push('--aggregate');
- }
- if (goConfig['toolsGopath']) {
- // gometalinter will expect its linters to be in the GOPATH
- // So add the toolsGopath to GOPATH
- lintEnv['GOPATH'] += path.delimiter + getToolsGopath();
- }
- }
if (lintTool === 'golangci-lint') {
if (args.indexOf('run') === -1) {
args.unshift('run');
diff --git a/src/goTools.ts b/src/goTools.ts
index 6e9c64a..a4ec994 100644
--- a/src/goTools.ts
+++ b/src/goTools.ts
@@ -343,7 +343,7 @@
name: 'golint',
importPath: 'golang.org/x/lint/golint',
replacedByGopls: false,
- isImportant: true,
+ isImportant: false,
description: 'Linter',
minimumGoVersion: semver.coerce('1.9')
},
diff --git a/test/integration/extension.test.ts b/test/integration/extension.test.ts
index 0d28d30..cd69f9d 100644
--- a/test/integration/extension.test.ts
+++ b/test/integration/extension.test.ts
@@ -425,8 +425,11 @@
const warnings = await goLint(
file2.uri,
Object.create(getGoConfig(), {
- lintTool: { value: 'golint' },
- lintFlags: { value: [] }
+ lintTool: { value: 'staticcheck' },
+ lintFlags: { value: ['-checks', 'all,-ST1000,-ST1016'] }
+ // staticcheck skips debatable checks such as ST1003 by default,
+ // but this test depends on ST1003 (MixedCaps package name) presented in both files
+ // in the same package. So, enable that.
}),
'package'
);
@@ -448,15 +451,17 @@
vetOnSave: { value: 'package' },
vetFlags: { value: ['-all'] },
lintOnSave: { value: 'package' },
- lintTool: { value: 'golint' },
+ lintTool: { value: 'staticcheck' },
lintFlags: { value: [] },
buildOnSave: { value: 'package' }
});
const expectedLintErrors = [
+ // Unlike golint, staticcheck will report only those compile errors,
+ // but not lint errors when the program is broken.
{
- line: 7,
+ line: 11,
severity: 'warning',
- msg: 'exported function Print2 should have comment or be unexported'
+ msg: 'undeclared name: prin (compile)'
}
];
// If a user has enabled diagnostics via a language server,
@@ -466,6 +471,7 @@To view, visit change 279212. To unsubscribe, or for help writing mail filters, visit settings.