You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution)
I can't even get the version
golangci-lint --version
Error: unknown flag: --version
Usage:
golangci-lint [flags]
golangci-lint [command]
Available Commands:
config Config
help Help
linters List current linters configuration
run Run this tool in cloud on every github pull request in https://golangci.com for free (public repos)
Flags:
--color string Use color when printing; can be 'always', 'auto', or 'never' (default "auto")
-j, --concurrency int Concurrency (default NumCPU) (default 4)
--cpu-profile-path string Path to CPU profile output file
-h, --help helpfor golangci-lint
--mem-profile-path string Path to memory profile output file
-v, --verbose verbose output
Use "golangci-lint [command] --help"for more information about a command.
failed executing command with error unknown flag: --version
Config file: cat .golangci.yml
run:
tests: true
linters:
enable:
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: true, auto-fix: false]
- govet # (vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: true, auto-fix: false]
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: true, auto-fix: false]
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false]
- unused # Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
- gosimple # Linter for Go source code that specializes in simplifying a code [fast: false, auto-fix: false]
- structcheck # Finds an unused struct fields [fast: true, auto-fix: false]
- varcheck # Finds unused global variables and constants [fast: true, auto-fix: false]
- ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false]
- deadcode # Finds unused code [fast: true, auto-fix: false]
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: true, auto-fix: false]
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true, auto-fix: false]
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
# TODO(mbana): enable these in next PR
# - gosec # Inspects source code for security problems [fast: true, auto-fix: false]
- interfacer # Linter that suggests narrower interface types [fast: false, auto-fix: false]
- unconvert # Remove unnecessary type conversions [fast: true, auto-fix: false]
- dupl # Tool for code clone detection [fast: true, auto-fix: false]
- goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false]
- gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false]
- lll # Reports long lines [fast: true, auto-fix: false]
- unparam # Reports unused function parameters [fast: false, auto-fix: false]
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
- megacheck
# TODO(mbana): enable these in next PR
- prealloc # Finds slice declarations that could potentially be preallocated [fast: true, auto-fix: false]
# - scopelint # Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false]
- gocritic # The most opinionated Go source code linter [fast: true, auto-fix: false]
# - gochecknoinits # Checks that no init functions are present in Go code [fast: true, auto-fix: false]
- gochecknoglobals # Checks that no globals are present in Go code [fast: true, auto-fix: false]
enable-all: false
disable-all: true
fast: false
# all available settings of specific linters
linters-settings:
govet:
# report about shadowed variables
check-shadowing: true
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
staticcheck:
fast: true
unused:
fast: true
gosimple:
fast: true
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 1.0
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: UK
gocyclo:
min-complexity: 13
interfacer:
fast: true
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 1024
fast: true
unparam:
fast: true
# see: https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml#L47
#
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
modules-download-mode: readonly
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
format: colored-line-number
# print lines of code with issue, default is true
print-issued-lines: false
# print linter name in the end of issue text, default is true
print-linter-name: true
issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
It's basically now impossible to use vscode with golangci-lint because just after starting to type everything gets super slow and I can see on my activity monitor 5 different processes for golangci-lint each one with 1GB ram usage.
The text was updated successfully, but these errors were encountered:
Impossible to use golangci-lint on vscode/go.12
Using the following settings on vscode
Please include the following information:
golangci-lint --version
(or git commit if you don't use binary distribution)I can't even get the version
cat .golangci.yml
go version && go env
It's basically now impossible to use vscode with golangci-lint because just after starting to type everything gets super slow and I can see on my activity monitor 5 different processes for golangci-lint each one with 1GB ram usage.
The text was updated successfully, but these errors were encountered: