Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Add staticcheck fixes: #2231 #2232

Merged
merged 1 commit into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Read the [Release Notes](https://github.com/Microsoft/vscode-go/wiki/Release-Not

- Build-on-save to compile code and show build errors. (using `go build` and `go test`)
- Vet-on-save to run `go vet` and show errors as warnings
- Lint-on-save to show linting errors as warnings (using `golint`, `gometalinter`, `megacheck`, `golangci-lint` or `revive`)
- Lint-on-save to show linting errors as warnings (using `golint`, `gometalinter`, `staticcheck`, `golangci-lint` or `revive`)
- Semantic/Syntactic error reporting as you type (using `gotype-live`)

### Testing
Expand Down Expand Up @@ -107,7 +107,7 @@ If you want to run only specific linters (some linters are slow), you can modify
"go.lintFlags": ["--disable=all", "--enable=errcheck"],
```

Alternatively, you can use [megacheck](https://github.com/dominikh/go-tools/tree/master/cmd/megacheck) which
Alternatively, you can use [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) which
may have significantly better performance than `gometalinter`, while only supporting a subset of the tools.

Another alternative is [golangci-lint](https://github.com/golangci/golangci-lint) which shares some of the performance
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@
"enum": [
"golint",
"gometalinter",
"megacheck",
"golangci-lint",
"revive"
"revive",
"staticcheck"
]
},
"go.lintFlags": {
Expand Down
10 changes: 5 additions & 5 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const _allTools: { [key: string]: string } = {
'golint': 'golang.org/x/lint/golint',
'gotests': 'github.com/cweill/gotests/...',
'gometalinter': 'github.com/alecthomas/gometalinter',
'megacheck': 'honnef.co/go/tools/...',
'staticcheck': 'honnef.co/go/tools/...',
'golangci-lint': 'github.com/golangci/golangci-lint/cmd/golangci-lint',
'revive': 'github.com/mgechev/revive',
'go-langserver': 'github.com/sourcegraph/go-langserver',
Expand Down Expand Up @@ -67,7 +67,7 @@ const importantTools = [
'goimports',
'golint',
'gometalinter',
'megacheck',
'staticcheck',
'golangci-lint',
'revive',
'dlv'
Expand Down Expand Up @@ -122,8 +122,8 @@ function getTools(goVersion: SemVersion): string[] {
tools.push('gometalinter');
}

if (goConfig['lintTool'] === 'megacheck') {
tools.push('megacheck');
if (goConfig['lintTool'] === 'staticcheck') {
tools.push('staticcheck');
}

if (goConfig['lintTool'] === 'golangci-lint') {
Expand Down Expand Up @@ -179,9 +179,9 @@ export function installAllTools(updateExistingToolsOnly: boolean = false) {
'golint': '\t\t(Linter)',
'gotests': '\t\t(Generate unit tests)',
'gometalinter': 'Linter)',
'megacheck': '\t(Linter)',
'golangci-lint': 'Linter)',
'revive': '\t\t(Linter)',
'staticcheck': '\t(Linter)',
'go-langserver': '(Language Server)',
'dlv': '\t\t\t(Debugging)',
'fillstruct': '\t\t(Fill structs with defaults)'
Expand Down