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
I want to pin the version of github.com/golangci/golangci-lint in my go.mod file and run it via go run ... kind of similar to the way you are doing version pinning in this project with third party Go-tools.
But golangci-lint returns with this error can't run linter goanalysis_metalinter: failed to pre-run depguard: failed to validate analyzers "depguard" has nil Run and exit status 3.
If I exclude depguard from the linters it will break with errcheck and so on.
I'm running go run github.com/golangci/golangci-lint/cmd/golangci-lint run on the root of my project with a go.mod file like so:
$ golangci-lint cache clean
$ golangci-lint run -vINFO [config_reader] Config search paths: [./ ~/Projects/my-repo/my-org/my-service ~/Projects/my-repo/my-org ~/Projects/my-repo ~/Projects ~ /Users /] INFO [config_reader] Used config file .golangci.yaml INFO [lintersdb] Active 80 linters: [asciicheck bidichk bodyclose containedctx contextcheck cyclop deadcode decorder depguard dogsled durationcheck errcheck errchkjson errname errorlint execinquery exhaustive exhaustruct exportloopref forbidigo forcetypeassert funlen gci gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo godot goerr113 gofmt gofumpt goheader goimports gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper ifshort importas ineffassign ireturn lll maintidx makezero misspell nakedret nestif nilerr noctx nolintlint nonamedreturns nosprintfhostport prealloc predeclared promlinter revive rowserrcheck sqlclosecheck staticcheck structcheck stylecheck tagliatelle tenv testpackage thelper tparallel typecheck unconvert unparam unused varcheck varnamelen wastedassign whitespace wrapcheck] INFO [loader] Go packages loading at mode 575 (imports|name|types_sizes|compiled_files|deps|exports_file|files) took 1.047941864s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 25.333283ms WARN [linters context] bodyclose is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] contextcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [runner] Can't run linter goanalysis_metalinter: failed to pre-run depguard: failed to validate analyzers: analyzer "depguard" has nil Run WARN [linters context] nilerr is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] noctx is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] rowserrcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] sqlclosecheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] structcheck is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] tparallel is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] unparam is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. WARN [linters context] wastedassign is disabled because of go1.18. You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649. INFO [runner] processing took 9.491µs with stages: max_same_issues: 4.204µs, nolint: 2.904µs, max_from_linter: 488ns, skip_dirs: 463ns, autogenerated_exclude: 329ns, skip_files: 142ns, cgo: 79ns, filename_unadjuster: 77ns, path_prettifier: 74ns, exclude: 72ns, path_shortener: 69ns, max_per_file_from_linter: 69ns, source_code: 68ns, uniq_by_line: 68ns, sort_results: 67ns, identifier_marker: 65ns, exclude-rules: 65ns, severity-rules: 65ns, path_prefixer: 64ns, diff: 59ns INFO [runner] linters took 10.968163ms with stages: rowserrcheck: 8.169751ms, goanalysis_metalinter: 72.242µs, sqlclosecheck: 53.433µs, bodyclose: 47.529µs, contextcheck: 13.519µs, structcheck: 13.189µs, tparallel: 11.791µs, unparam: 11.33µs, wastedassign: 10.633µs, noctx: 6.435µs, nilerr: 6.407µs ERRO Running error: 1 error occurred: * can't run linter goanalysis_metalinter: failed to pre-run depguard: failed to validate analyzers: analyzer "depguard" has nil RunINFO Memory: 13 samples, avg is 40.9MB, max is 44.5MB INFO Execution took 1.112566516s exit status 3
Code example or link to a public repository
Just a basic project. The project runs fine if I pre-compile the golangci-lint binary and apply it in regular fashion.
The text was updated successfully, but these errors were encountered:
Welcome
Description of the problem
I want to pin the version of
github.com/golangci/golangci-lint
in my go.mod file and run it viago run ...
kind of similar to the way you are doing version pinning in this project with third party Go-tools.But
golangci-lint
returns with this errorcan't run linter goanalysis_metalinter: failed to pre-run depguard: failed to validate analyzers "depguard" has nil Run
and exit status 3.If I exclude
depguard
from the linters it will break witherrcheck
and so on.I'm running
go run github.com/golangci/golangci-lint/cmd/golangci-lint run
on the root of my project with ago.mod
file like so:Version of golangci-lint
Running
go run github.com/golangci/golangci-lint/cmd/golangci-lint --version
will return (any idea why these two fields are
unknown
???):Configuration file
I don't believe it is a problem in the config, but here you go:
Go environment
Here's my
go env
:Verbose output of running
Code example or link to a public repository
Just a basic project. The project runs fine if I pre-compile the
golangci-lint
binary and apply it in regular fashion.The text was updated successfully, but these errors were encountered: