Repository: golangci/golangci-lint Branch: main Commit: b7ca3baed01b Files: 1800 Total size: 8.4 MB Directory structure: gitextract_2yvj2yhy/ ├── .custom-gcl.reference.yml ├── .gitattributes ├── .github/ │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.yml │ │ ├── config.yml │ │ └── feature_request.yml │ ├── PULL_REQUEST_TEMPLATE.md │ ├── boring-cyborg.yml │ ├── dependabot.yml │ ├── new-linter-checklist.md │ ├── peril/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── package.json │ │ ├── rules/ │ │ │ └── invite-collaborator.ts │ │ ├── settings.json │ │ ├── tests/ │ │ │ └── invite-collaborator.test.ts │ │ └── tsconfig.json │ ├── stale.yml │ └── workflows/ │ ├── codeql.yml │ ├── deploy-documentation.yml │ ├── new-linter-checklist.yml │ ├── post-release.yml │ ├── pr-checks.yml │ ├── pr-documentation.yml │ ├── pr-tests.yml │ └── release.yml ├── .gitignore ├── .golangci.next.reference.yml ├── .golangci.reference.yml ├── .golangci.yml ├── .goreleaser.yml ├── .pre-commit-hooks.yaml ├── CHANGELOG-v1.md ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── assets/ │ ├── github-action-config-v1.json │ ├── github-action-config-v2.json │ └── github-action-config.json ├── build/ │ ├── buildx-alpine.Dockerfile │ └── buildx.Dockerfile ├── cmd/ │ └── golangci-lint/ │ ├── main.go │ └── plugins.go ├── docs/ │ ├── .gitignore │ ├── Makefile │ ├── archetypes/ │ │ └── default.md │ ├── assets/ │ │ └── css/ │ │ └── custom.css │ ├── content/ │ │ ├── _index.md │ │ └── docs/ │ │ ├── _index.md │ │ ├── configuration/ │ │ │ ├── _index.md │ │ │ ├── cli.md │ │ │ └── file.md │ │ ├── contributing/ │ │ │ ├── _index.md │ │ │ ├── architecture.md │ │ │ ├── debug.md │ │ │ ├── faq.md │ │ │ ├── new-linters.md │ │ │ ├── website.md │ │ │ └── workflow.md │ │ ├── donate/ │ │ │ └── _index.md │ │ ├── formatters/ │ │ │ ├── _index.md │ │ │ └── configuration.md │ │ ├── linters/ │ │ │ ├── _index.md │ │ │ ├── configuration.md │ │ │ └── false-positives.md │ │ ├── plugins/ │ │ │ ├── _index.md │ │ │ ├── go-plugins.md │ │ │ └── module-plugins.md │ │ ├── product/ │ │ │ ├── _index.md │ │ │ ├── changelog-v1.md │ │ │ ├── changelog.md │ │ │ ├── migration-guide.md │ │ │ ├── roadmap.md │ │ │ └── thanks.md │ │ └── welcome/ │ │ ├── _index.md │ │ ├── faq.md │ │ ├── install/ │ │ │ ├── _index.md │ │ │ ├── ci.md │ │ │ └── local.md │ │ ├── integrations.md │ │ └── quick-start.md │ ├── data/ │ │ ├── cli_help.json │ │ ├── configuration_file.json │ │ ├── exclusion_presets.json │ │ ├── formatters_info.json │ │ ├── icons.yaml │ │ ├── linters_info.json │ │ └── thanks.json │ ├── go.mod │ ├── go.sum │ ├── golangci-lint.tape │ ├── hugo.yaml │ ├── i18n/ │ │ └── en.yaml │ ├── layouts/ │ │ ├── 404.html │ │ ├── _partials/ │ │ │ ├── custom/ │ │ │ │ └── head-end.html │ │ │ ├── footer.html │ │ │ ├── golangci/ │ │ │ │ └── items/ │ │ │ │ ├── compare-versions.html │ │ │ │ ├── format-description.html │ │ │ │ └── tag.html │ │ │ └── shortcodes/ │ │ │ ├── badge.html │ │ │ └── cards.html │ │ └── _shortcodes/ │ │ ├── cards.html │ │ ├── details.html │ │ └── golangci/ │ │ ├── authors.html │ │ ├── button.html │ │ ├── cli-output.html │ │ ├── configuration-file-snippet.html │ │ ├── embed.html │ │ ├── exclusion-preset-tables.html │ │ ├── exclusion-presets-snippet.html │ │ ├── image-card.html │ │ ├── items/ │ │ │ ├── cards.html │ │ │ ├── filter-badge.html │ │ │ ├── filter.html │ │ │ └── settings.html │ │ ├── latest-version.html │ │ └── starcharts.html │ └── static/ │ ├── CNAME │ └── site.webmanifest ├── go.mod ├── go.sum ├── install.sh ├── internal/ │ ├── cache/ │ │ ├── cache.go │ │ ├── cache_test.go │ │ └── testdata/ │ │ └── hello.go │ ├── errorutil/ │ │ └── errors.go │ ├── go/ │ │ ├── LICENSE │ │ ├── base/ │ │ │ ├── error_notunix.go │ │ │ ├── error_unix.go │ │ │ └── readme.md │ │ ├── cache/ │ │ │ ├── cache.go │ │ │ ├── cache_gcil.go │ │ │ ├── cache_test.go │ │ │ ├── default.go │ │ │ ├── default_gcil.go │ │ │ ├── hash.go │ │ │ ├── hash_gcil.go │ │ │ ├── hash_test.go │ │ │ ├── prog.go │ │ │ └── readme.md │ │ ├── cacheprog/ │ │ │ ├── cacheprog.go │ │ │ └── readme.md │ │ ├── mmap/ │ │ │ ├── mmap.go │ │ │ ├── mmap_other.go │ │ │ ├── mmap_unix.go │ │ │ ├── mmap_windows.go │ │ │ └── readme.md │ │ ├── quoted/ │ │ │ ├── quoted.go │ │ │ ├── quoted_test.go │ │ │ └── readme.md │ │ └── testenv/ │ │ ├── readme.md │ │ ├── testenv.go │ │ ├── testenv_notunix.go │ │ ├── testenv_notwin.go │ │ ├── testenv_unix.go │ │ └── testenv_windows.go │ └── x/ │ ├── LICENSE │ └── tools/ │ ├── diff/ │ │ ├── diff.go │ │ ├── lcs/ │ │ │ ├── common.go │ │ │ ├── common_test.go │ │ │ ├── doc.go │ │ │ ├── git.sh │ │ │ ├── labels.go │ │ │ ├── old.go │ │ │ ├── old_test.go │ │ │ └── sequence.go │ │ ├── myers/ │ │ │ └── diff.go │ │ ├── ndiff.go │ │ ├── readme.md │ │ └── unified.go │ └── driverutil/ │ ├── readfile.go │ ├── readme.md │ └── url.go ├── jsonschema/ │ ├── custom-gcl.jsonschema.json │ ├── golangci.jsonschema.json │ ├── golangci.next.jsonschema.json │ ├── golangci.v1.57.jsonschema.json │ ├── golangci.v1.58.jsonschema.json │ ├── golangci.v1.59.jsonschema.json │ ├── golangci.v1.60.jsonschema.json │ ├── golangci.v1.61.jsonschema.json │ ├── golangci.v1.62.jsonschema.json │ ├── golangci.v1.63.jsonschema.json │ ├── golangci.v1.64.jsonschema.json │ ├── golangci.v1.jsonschema.json │ ├── golangci.v2.0.jsonschema.json │ ├── golangci.v2.1.jsonschema.json │ ├── golangci.v2.10.jsonschema.json │ ├── golangci.v2.2.jsonschema.json │ ├── golangci.v2.3.jsonschema.json │ ├── golangci.v2.4.jsonschema.json │ ├── golangci.v2.5.jsonschema.json │ ├── golangci.v2.6.jsonschema.json │ ├── golangci.v2.7.jsonschema.json │ ├── golangci.v2.8.jsonschema.json │ └── golangci.v2.9.jsonschema.json ├── pkg/ │ ├── commands/ │ │ ├── cache.go │ │ ├── config.go │ │ ├── config_verify.go │ │ ├── config_verify_test.go │ │ ├── custom.go │ │ ├── flagsets.go │ │ ├── fmt.go │ │ ├── formatters.go │ │ ├── help.go │ │ ├── help_formatters.go │ │ ├── help_linters.go │ │ ├── help_test.go │ │ ├── internal/ │ │ │ ├── builder.go │ │ │ ├── builder_test.go │ │ │ ├── configuration.go │ │ │ ├── configuration_test.go │ │ │ ├── dirhash.go │ │ │ ├── imports.go │ │ │ ├── imports_test.go │ │ │ ├── migrate/ │ │ │ │ ├── cloner/ │ │ │ │ │ └── cloner.go │ │ │ │ ├── fakeloader/ │ │ │ │ │ ├── config.go │ │ │ │ │ └── fakeloader.go │ │ │ │ ├── migrate.go │ │ │ │ ├── migrate_formatters.go │ │ │ │ ├── migrate_issues.go │ │ │ │ ├── migrate_linter_names.go │ │ │ │ ├── migrate_linter_names_test.go │ │ │ │ ├── migrate_linters.go │ │ │ │ ├── migrate_linters_exclusions.go │ │ │ │ ├── migrate_linters_settings.go │ │ │ │ ├── migrate_output.go │ │ │ │ ├── migrate_run.go │ │ │ │ ├── migrate_severity.go │ │ │ │ ├── migrate_test.go │ │ │ │ ├── parser/ │ │ │ │ │ └── parser.go │ │ │ │ ├── ptr/ │ │ │ │ │ └── ptr.go │ │ │ │ ├── testdata/ │ │ │ │ │ ├── json/ │ │ │ │ │ │ ├── empty.golden.json │ │ │ │ │ │ └── empty.json │ │ │ │ │ ├── toml/ │ │ │ │ │ │ ├── empty.golden.toml │ │ │ │ │ │ ├── empty.toml │ │ │ │ │ │ ├── linters-settings_goheader.golden.toml │ │ │ │ │ │ └── linters-settings_goheader.toml │ │ │ │ │ └── yaml/ │ │ │ │ │ ├── empty.golden.yml │ │ │ │ │ ├── empty.yml │ │ │ │ │ ├── issues_01_a.golden.yml │ │ │ │ │ ├── issues_01_a.yml │ │ │ │ │ ├── issues_01_b.golden.yml │ │ │ │ │ ├── issues_01_b.yml │ │ │ │ │ ├── issues_02_a.golden.yml │ │ │ │ │ ├── issues_02_a.yml │ │ │ │ │ ├── issues_02_b.golden.yml │ │ │ │ │ ├── issues_02_b.yml │ │ │ │ │ ├── issues_04_a.golden.yml │ │ │ │ │ ├── issues_04_a.yml │ │ │ │ │ ├── issues_04_b.golden.yml │ │ │ │ │ ├── issues_04_b.yml │ │ │ │ │ ├── issues_04_c.golden.yml │ │ │ │ │ ├── issues_04_c.yml │ │ │ │ │ ├── issues_05_a.golden.yml │ │ │ │ │ ├── issues_05_a.yml │ │ │ │ │ ├── issues_05_b.golden.yml │ │ │ │ │ ├── issues_05_b.yml │ │ │ │ │ ├── issues_05_c.golden.yml │ │ │ │ │ ├── issues_05_c.yml │ │ │ │ │ ├── issues_06_a.golden.yml │ │ │ │ │ ├── issues_06_a.yml │ │ │ │ │ ├── issues_06_b.golden.yml │ │ │ │ │ ├── issues_06_b.yml │ │ │ │ │ ├── issues_06_c.golden.yml │ │ │ │ │ ├── issues_06_c.yml │ │ │ │ │ ├── issues_06_d.golden.yml │ │ │ │ │ ├── issues_06_d.yml │ │ │ │ │ ├── issues_06_e.golden.yml │ │ │ │ │ ├── issues_06_e.yml │ │ │ │ │ ├── issues_06_f.golden.yml │ │ │ │ │ ├── issues_06_f.yml │ │ │ │ │ ├── issues_06_g.golden.yml │ │ │ │ │ ├── issues_06_g.yml │ │ │ │ │ ├── issues_06_h.golden.yml │ │ │ │ │ ├── issues_06_h.yml │ │ │ │ │ ├── issues_07_a.golden.yml │ │ │ │ │ ├── issues_07_a.yml │ │ │ │ │ ├── issues_07_b.golden.yml │ │ │ │ │ ├── issues_07_b.yml │ │ │ │ │ ├── issues_08_a.golden.yml │ │ │ │ │ ├── issues_08_a.yml │ │ │ │ │ ├── issues_08_b.golden.yml │ │ │ │ │ ├── issues_08_b.yml │ │ │ │ │ ├── issues_09_a.golden.yml │ │ │ │ │ ├── issues_09_a.yml │ │ │ │ │ ├── issues_09_b.golden.yml │ │ │ │ │ ├── issues_09_b.yml │ │ │ │ │ ├── issues_10.golden.yml │ │ │ │ │ ├── issues_10.yml │ │ │ │ │ ├── linters-settings_asasalint.golden.yml │ │ │ │ │ ├── linters-settings_asasalint.yml │ │ │ │ │ ├── linters-settings_bidichk.golden.yml │ │ │ │ │ ├── linters-settings_bidichk.yml │ │ │ │ │ ├── linters-settings_copyloopvar.golden.yml │ │ │ │ │ ├── linters-settings_copyloopvar.yml │ │ │ │ │ ├── linters-settings_custom.golden.yml │ │ │ │ │ ├── linters-settings_custom.yml │ │ │ │ │ ├── linters-settings_cyclop.golden.yml │ │ │ │ │ ├── linters-settings_cyclop.yml │ │ │ │ │ ├── linters-settings_decorder.golden.yml │ │ │ │ │ ├── linters-settings_decorder.yml │ │ │ │ │ ├── linters-settings_depguard.golden.yml │ │ │ │ │ ├── linters-settings_depguard.yml │ │ │ │ │ ├── linters-settings_dogsled.golden.yml │ │ │ │ │ ├── linters-settings_dogsled.yml │ │ │ │ │ ├── linters-settings_dupl.golden.yml │ │ │ │ │ ├── linters-settings_dupl.yml │ │ │ │ │ ├── linters-settings_dupword.golden.yml │ │ │ │ │ ├── linters-settings_dupword.yml │ │ │ │ │ ├── linters-settings_errcheck.golden.yml │ │ │ │ │ ├── linters-settings_errcheck.yml │ │ │ │ │ ├── linters-settings_errchkjson.golden.yml │ │ │ │ │ ├── linters-settings_errchkjson.yml │ │ │ │ │ ├── linters-settings_errorlint.golden.yml │ │ │ │ │ ├── linters-settings_errorlint.yml │ │ │ │ │ ├── linters-settings_exhaustive.golden.yml │ │ │ │ │ ├── linters-settings_exhaustive.yml │ │ │ │ │ ├── linters-settings_exhaustruct.golden.yml │ │ │ │ │ ├── linters-settings_exhaustruct.yml │ │ │ │ │ ├── linters-settings_fatcontext.golden.yml │ │ │ │ │ ├── linters-settings_fatcontext.yml │ │ │ │ │ ├── linters-settings_forbidigo.golden.yml │ │ │ │ │ ├── linters-settings_forbidigo.yml │ │ │ │ │ ├── linters-settings_funlen.golden.yml │ │ │ │ │ ├── linters-settings_funlen.yml │ │ │ │ │ ├── linters-settings_gci.golden.yml │ │ │ │ │ ├── linters-settings_gci.yml │ │ │ │ │ ├── linters-settings_ginkgolinter.golden.yml │ │ │ │ │ ├── linters-settings_ginkgolinter.yml │ │ │ │ │ ├── linters-settings_gochecksumtype.golden.yml │ │ │ │ │ ├── linters-settings_gochecksumtype.yml │ │ │ │ │ ├── linters-settings_gocognit.golden.yml │ │ │ │ │ ├── linters-settings_gocognit.yml │ │ │ │ │ ├── linters-settings_goconst.golden.yml │ │ │ │ │ ├── linters-settings_goconst.yml │ │ │ │ │ ├── linters-settings_gocritic.golden.yml │ │ │ │ │ ├── linters-settings_gocritic.yml │ │ │ │ │ ├── linters-settings_gocyclo.golden.yml │ │ │ │ │ ├── linters-settings_gocyclo.yml │ │ │ │ │ ├── linters-settings_godot.golden.yml │ │ │ │ │ ├── linters-settings_godot.yml │ │ │ │ │ ├── linters-settings_godox.golden.yml │ │ │ │ │ ├── linters-settings_godox.yml │ │ │ │ │ ├── linters-settings_gofmt.golden.yml │ │ │ │ │ ├── linters-settings_gofmt.yml │ │ │ │ │ ├── linters-settings_gofumpt.golden.yml │ │ │ │ │ ├── linters-settings_gofumpt.yml │ │ │ │ │ ├── linters-settings_goheader.golden.yml │ │ │ │ │ ├── linters-settings_goheader.yml │ │ │ │ │ ├── linters-settings_goimports.golden.yml │ │ │ │ │ ├── linters-settings_goimports.yml │ │ │ │ │ ├── linters-settings_gomoddirectives.golden.yml │ │ │ │ │ ├── linters-settings_gomoddirectives.yml │ │ │ │ │ ├── linters-settings_gomodguard.golden.yml │ │ │ │ │ ├── linters-settings_gomodguard.yml │ │ │ │ │ ├── linters-settings_gosec.golden.yml │ │ │ │ │ ├── linters-settings_gosec.yml │ │ │ │ │ ├── linters-settings_gosimple.golden.yml │ │ │ │ │ ├── linters-settings_gosimple.yml │ │ │ │ │ ├── linters-settings_gosmopolitan.golden.yml │ │ │ │ │ ├── linters-settings_gosmopolitan.yml │ │ │ │ │ ├── linters-settings_govet.golden.yml │ │ │ │ │ ├── linters-settings_govet.yml │ │ │ │ │ ├── linters-settings_grouper.golden.yml │ │ │ │ │ ├── linters-settings_grouper.yml │ │ │ │ │ ├── linters-settings_iface.golden.yml │ │ │ │ │ ├── linters-settings_iface.yml │ │ │ │ │ ├── linters-settings_importas.golden.yml │ │ │ │ │ ├── linters-settings_importas.yml │ │ │ │ │ ├── linters-settings_inamedparam.golden.yml │ │ │ │ │ ├── linters-settings_inamedparam.yml │ │ │ │ │ ├── linters-settings_interfacebloat.golden.yml │ │ │ │ │ ├── linters-settings_interfacebloat.yml │ │ │ │ │ ├── linters-settings_ireturn.golden.yml │ │ │ │ │ ├── linters-settings_ireturn.yml │ │ │ │ │ ├── linters-settings_lll.golden.yml │ │ │ │ │ ├── linters-settings_lll.yml │ │ │ │ │ ├── linters-settings_loggercheck.golden.yml │ │ │ │ │ ├── linters-settings_loggercheck.yml │ │ │ │ │ ├── linters-settings_maintidx.golden.yml │ │ │ │ │ ├── linters-settings_maintidx.yml │ │ │ │ │ ├── linters-settings_makezero.golden.yml │ │ │ │ │ ├── linters-settings_makezero.yml │ │ │ │ │ ├── linters-settings_misspell.golden.yml │ │ │ │ │ ├── linters-settings_misspell.yml │ │ │ │ │ ├── linters-settings_mnd.golden.yml │ │ │ │ │ ├── linters-settings_mnd.yml │ │ │ │ │ ├── linters-settings_musttag.golden.yml │ │ │ │ │ ├── linters-settings_musttag.yml │ │ │ │ │ ├── linters-settings_nakedret.golden.yml │ │ │ │ │ ├── linters-settings_nakedret.yml │ │ │ │ │ ├── linters-settings_nakedret_zero.golden.yml │ │ │ │ │ ├── linters-settings_nakedret_zero.yml │ │ │ │ │ ├── linters-settings_nestif.golden.yml │ │ │ │ │ ├── linters-settings_nestif.yml │ │ │ │ │ ├── linters-settings_nilnil.golden.yml │ │ │ │ │ ├── linters-settings_nilnil.yml │ │ │ │ │ ├── linters-settings_nlreturn.golden.yml │ │ │ │ │ ├── linters-settings_nlreturn.yml │ │ │ │ │ ├── linters-settings_nolintlint.golden.yml │ │ │ │ │ ├── linters-settings_nolintlint.yml │ │ │ │ │ ├── linters-settings_nonamedreturns.golden.yml │ │ │ │ │ ├── linters-settings_nonamedreturns.yml │ │ │ │ │ ├── linters-settings_paralleltest.golden.yml │ │ │ │ │ ├── linters-settings_paralleltest.yml │ │ │ │ │ ├── linters-settings_perfsprint.golden.yml │ │ │ │ │ ├── linters-settings_perfsprint.yml │ │ │ │ │ ├── linters-settings_prealloc.golden.yml │ │ │ │ │ ├── linters-settings_prealloc.yml │ │ │ │ │ ├── linters-settings_predeclared.golden.yml │ │ │ │ │ ├── linters-settings_predeclared.yml │ │ │ │ │ ├── linters-settings_promlinter.golden.yml │ │ │ │ │ ├── linters-settings_promlinter.yml │ │ │ │ │ ├── linters-settings_protogetter.golden.yml │ │ │ │ │ ├── linters-settings_protogetter.yml │ │ │ │ │ ├── linters-settings_reassign.golden.yml │ │ │ │ │ ├── linters-settings_reassign.yml │ │ │ │ │ ├── linters-settings_recvcheck.golden.yml │ │ │ │ │ ├── linters-settings_recvcheck.yml │ │ │ │ │ ├── linters-settings_revive.golden.yml │ │ │ │ │ ├── linters-settings_revive.yml │ │ │ │ │ ├── linters-settings_rowserrcheck.golden.yml │ │ │ │ │ ├── linters-settings_rowserrcheck.yml │ │ │ │ │ ├── linters-settings_sloglint.golden.yml │ │ │ │ │ ├── linters-settings_sloglint.yml │ │ │ │ │ ├── linters-settings_spancheck.golden.yml │ │ │ │ │ ├── linters-settings_spancheck.yml │ │ │ │ │ ├── linters-settings_staticcheck.golden.yml │ │ │ │ │ ├── linters-settings_staticcheck.yml │ │ │ │ │ ├── linters-settings_staticcheck_merge.golden.yml │ │ │ │ │ ├── linters-settings_staticcheck_merge.yml │ │ │ │ │ ├── linters-settings_stylecheck.golden.yml │ │ │ │ │ ├── linters-settings_stylecheck.yml │ │ │ │ │ ├── linters-settings_tagalign.golden.yml │ │ │ │ │ ├── linters-settings_tagalign.yml │ │ │ │ │ ├── linters-settings_tagliatelle.golden.yml │ │ │ │ │ ├── linters-settings_tagliatelle.yml │ │ │ │ │ ├── linters-settings_testifylint.golden.yml │ │ │ │ │ ├── linters-settings_testifylint.yml │ │ │ │ │ ├── linters-settings_testpackage.golden.yml │ │ │ │ │ ├── linters-settings_testpackage.yml │ │ │ │ │ ├── linters-settings_thelper.golden.yml │ │ │ │ │ ├── linters-settings_thelper.yml │ │ │ │ │ ├── linters-settings_unconvert.golden.yml │ │ │ │ │ ├── linters-settings_unconvert.yml │ │ │ │ │ ├── linters-settings_unparam.golden.yml │ │ │ │ │ ├── linters-settings_unparam.yml │ │ │ │ │ ├── linters-settings_unused.golden.yml │ │ │ │ │ ├── linters-settings_unused.yml │ │ │ │ │ ├── linters-settings_usestdlibvars.golden.yml │ │ │ │ │ ├── linters-settings_usestdlibvars.yml │ │ │ │ │ ├── linters-settings_usetesting.golden.yml │ │ │ │ │ ├── linters-settings_usetesting.yml │ │ │ │ │ ├── linters-settings_varnamelen.golden.yml │ │ │ │ │ ├── linters-settings_varnamelen.yml │ │ │ │ │ ├── linters-settings_whitespace.golden.yml │ │ │ │ │ ├── linters-settings_whitespace.yml │ │ │ │ │ ├── linters-settings_wrapcheck.golden.yml │ │ │ │ │ ├── linters-settings_wrapcheck.yml │ │ │ │ │ ├── linters-settings_wsl.golden.yml │ │ │ │ │ ├── linters-settings_wsl.yml │ │ │ │ │ ├── linters_01.golden.yml │ │ │ │ │ ├── linters_01.yml │ │ │ │ │ ├── linters_02.golden.yml │ │ │ │ │ ├── linters_02.yml │ │ │ │ │ ├── linters_03.golden.yml │ │ │ │ │ ├── linters_03.yml │ │ │ │ │ ├── linters_04.golden.yml │ │ │ │ │ ├── linters_04.yml │ │ │ │ │ ├── linters_05.golden.yml │ │ │ │ │ ├── linters_05.yml │ │ │ │ │ ├── linters_06.golden.yml │ │ │ │ │ ├── linters_06.yml │ │ │ │ │ ├── linters_07.golden.yml │ │ │ │ │ ├── linters_07.yml │ │ │ │ │ ├── linters_08.golden.yml │ │ │ │ │ ├── linters_08.yml │ │ │ │ │ ├── linters_09.golden.yml │ │ │ │ │ ├── linters_09.yml │ │ │ │ │ ├── linters_10.golden.yml │ │ │ │ │ ├── linters_10.yml │ │ │ │ │ ├── linters_11.golden.yml │ │ │ │ │ ├── linters_11.yml │ │ │ │ │ ├── linters_12.golden.yml │ │ │ │ │ ├── linters_12.yml │ │ │ │ │ ├── linters_13_a.golden.yml │ │ │ │ │ ├── linters_13_a.yml │ │ │ │ │ ├── linters_13_b.golden.yml │ │ │ │ │ ├── linters_13_b.yml │ │ │ │ │ ├── linters_13_c.golden.yml │ │ │ │ │ ├── linters_13_c.yml │ │ │ │ │ ├── linters_13_d.golden.yml │ │ │ │ │ ├── linters_13_d.yml │ │ │ │ │ ├── output_01_a.golden.yml │ │ │ │ │ ├── output_01_a.yml │ │ │ │ │ ├── output_01_b.golden.yml │ │ │ │ │ ├── output_01_b.yml │ │ │ │ │ ├── output_01_c.golden.yml │ │ │ │ │ ├── output_01_c.yml │ │ │ │ │ ├── output_01_d.golden.yml │ │ │ │ │ ├── output_01_d.yml │ │ │ │ │ ├── output_01_f.golden.yml │ │ │ │ │ ├── output_01_f.yml │ │ │ │ │ ├── output_01_g.golden.yml │ │ │ │ │ ├── output_01_g.yml │ │ │ │ │ ├── output_01_h.golden.yml │ │ │ │ │ ├── output_01_h.yml │ │ │ │ │ ├── output_01_i.golden.yml │ │ │ │ │ ├── output_01_i.yml │ │ │ │ │ ├── output_01_j.golden.yml │ │ │ │ │ ├── output_01_j.yml │ │ │ │ │ ├── output_01_k.golden.yml │ │ │ │ │ ├── output_01_k.yml │ │ │ │ │ ├── output_01_l.golden.yml │ │ │ │ │ ├── output_01_l.yml │ │ │ │ │ ├── output_01_m.golden.yml │ │ │ │ │ ├── output_01_m.yml │ │ │ │ │ ├── output_01_o.golden.yml │ │ │ │ │ ├── output_01_o.yml │ │ │ │ │ ├── output_01_p.golden.yml │ │ │ │ │ ├── output_01_p.yml │ │ │ │ │ ├── output_02.golden.yml │ │ │ │ │ ├── output_02.yml │ │ │ │ │ ├── output_03.golden.yml │ │ │ │ │ ├── output_03.yml │ │ │ │ │ ├── output_04.golden.yml │ │ │ │ │ ├── output_04.yml │ │ │ │ │ ├── run_01.golden.yml │ │ │ │ │ ├── run_01.yml │ │ │ │ │ ├── run_02_a.golden.yml │ │ │ │ │ ├── run_02_a.yml │ │ │ │ │ ├── run_02_b.golden.yml │ │ │ │ │ ├── run_02_b.yml │ │ │ │ │ ├── run_03_a.golden.yml │ │ │ │ │ ├── run_03_a.yml │ │ │ │ │ ├── run_03_b.golden.yml │ │ │ │ │ ├── run_03_b.yml │ │ │ │ │ ├── run_04_a.golden.yml │ │ │ │ │ ├── run_04_a.yml │ │ │ │ │ ├── run_04_b.golden.yml │ │ │ │ │ ├── run_04_b.yml │ │ │ │ │ ├── run_05.golden.yml │ │ │ │ │ ├── run_05.yml │ │ │ │ │ ├── run_06.golden.yml │ │ │ │ │ ├── run_06.yml │ │ │ │ │ ├── run_07.golden.yml │ │ │ │ │ ├── run_07.yml │ │ │ │ │ ├── run_08.golden.yml │ │ │ │ │ ├── run_08.yml │ │ │ │ │ ├── run_09_a.golden.yml │ │ │ │ │ ├── run_09_a.yml │ │ │ │ │ ├── run_09_b.golden.yml │ │ │ │ │ ├── run_09_b.yml │ │ │ │ │ ├── run_10.golden.yml │ │ │ │ │ ├── run_10.yml │ │ │ │ │ ├── severity_01.golden.yml │ │ │ │ │ ├── severity_01.yml │ │ │ │ │ ├── severity_02.golden.yml │ │ │ │ │ ├── severity_02.yml │ │ │ │ │ ├── severity_03.golden.yml │ │ │ │ │ ├── severity_03.yml │ │ │ │ │ ├── unknown-fields.golden.yml │ │ │ │ │ └── unknown-fields.yml │ │ │ │ ├── versionone/ │ │ │ │ │ ├── base_rule.go │ │ │ │ │ ├── config.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── issues.go │ │ │ │ │ ├── linters.go │ │ │ │ │ ├── linters_settings.go │ │ │ │ │ ├── output.go │ │ │ │ │ ├── run.go │ │ │ │ │ └── severity.go │ │ │ │ └── versiontwo/ │ │ │ │ ├── base_rule.go │ │ │ │ ├── config.go │ │ │ │ ├── formatters.go │ │ │ │ ├── formatters_settings.go │ │ │ │ ├── issues.go │ │ │ │ ├── linters.go │ │ │ │ ├── linters_exclusions.go │ │ │ │ ├── linters_settings.go │ │ │ │ ├── output.go │ │ │ │ ├── output_formats.go │ │ │ │ ├── run.go │ │ │ │ └── severity.go │ │ │ ├── testdata/ │ │ │ │ └── imports.go │ │ │ └── vibra.go │ │ ├── linters.go │ │ ├── migrate.go │ │ ├── root.go │ │ ├── run.go │ │ └── version.go │ ├── config/ │ │ ├── base_loader.go │ │ ├── base_rule.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── formatters.go │ │ ├── formatters_settings.go │ │ ├── issues.go │ │ ├── linters.go │ │ ├── linters_exclusions.go │ │ ├── linters_exclusions_test.go │ │ ├── linters_settings.go │ │ ├── linters_settings_test.go │ │ ├── loader.go │ │ ├── output.go │ │ ├── output_formats.go │ │ ├── output_test.go │ │ ├── placeholders.go │ │ ├── run.go │ │ ├── run_test.go │ │ ├── severity.go │ │ └── severity_test.go │ ├── exitcodes/ │ │ └── exitcodes.go │ ├── fsutils/ │ │ ├── basepath.go │ │ ├── filecache.go │ │ ├── fsutils.go │ │ ├── fsutils_test.go │ │ ├── fsutils_unix.go │ │ ├── fsutils_windows.go │ │ ├── linecache.go │ │ ├── path_unix.go │ │ └── path_windows.go │ ├── goanalysis/ │ │ ├── issue.go │ │ ├── linter.go │ │ ├── load/ │ │ │ └── guard.go │ │ ├── metalinter.go │ │ ├── pkgerrors/ │ │ │ ├── errors.go │ │ │ ├── extract.go │ │ │ ├── extract_test.go │ │ │ ├── parse.go │ │ │ └── parse_test.go │ │ ├── position.go │ │ ├── runner.go │ │ ├── runner_action.go │ │ ├── runner_action_cache.go │ │ ├── runner_action_test.go │ │ ├── runner_checker.go │ │ ├── runner_loadingpackage.go │ │ ├── runners.go │ │ └── runners_cache.go │ ├── goformat/ │ │ ├── runner.go │ │ └── runner_test.go │ ├── goformatters/ │ │ ├── analyzer.go │ │ ├── formatters.go │ │ ├── gci/ │ │ │ ├── gci.go │ │ │ └── internal/ │ │ │ ├── LICENSE │ │ │ ├── config/ │ │ │ │ └── config.go │ │ │ ├── readme.md │ │ │ └── section/ │ │ │ ├── parser.go │ │ │ ├── section.go │ │ │ ├── standard.go │ │ │ └── standard_list.go │ │ ├── gofmt/ │ │ │ └── gofmt.go │ │ ├── gofumpt/ │ │ │ └── gofumpt.go │ │ ├── goimports/ │ │ │ └── goimports.go │ │ ├── golines/ │ │ │ └── golines.go │ │ ├── internal/ │ │ │ ├── commons.go │ │ │ ├── diff.go │ │ │ ├── diff_test.go │ │ │ └── testdata/ │ │ │ ├── add_only.diff │ │ │ ├── add_only_different_lines.diff │ │ │ ├── add_only_in_all_diff.diff │ │ │ ├── add_only_multiple_lines.diff │ │ │ ├── add_only_on_first_line.diff │ │ │ ├── add_only_on_first_line_with_shared_original_line.diff │ │ │ ├── delete_last_line.diff │ │ │ ├── delete_only_first_lines.diff │ │ │ ├── gofmt_diff.diff │ │ │ ├── replace_line.diff │ │ │ └── replace_line_after_first_line_adding.diff │ │ ├── meta_formatter.go │ │ └── swaggo/ │ │ └── swaggo.go │ ├── golinters/ │ │ ├── arangolint/ │ │ │ ├── arangolint.go │ │ │ ├── arangolint_integration_test.go │ │ │ └── testdata/ │ │ │ ├── arangolint.go │ │ │ ├── arangolint_cgo.go │ │ │ ├── go.mod │ │ │ └── go.sum │ │ ├── asasalint/ │ │ │ ├── asasalint.go │ │ │ ├── asasalint_integration_test.go │ │ │ └── testdata/ │ │ │ ├── asasalint.go │ │ │ └── asasalint_cgo.go │ │ ├── asciicheck/ │ │ │ ├── asciicheck.go │ │ │ ├── asciicheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── asciicheck.go │ │ │ └── asciicheck_cgo.go │ │ ├── bidichk/ │ │ │ ├── bidichk.go │ │ │ ├── bidichk_integration_test.go │ │ │ └── testdata/ │ │ │ ├── bidichk.go │ │ │ └── bidichk_cgo.go │ │ ├── bodyclose/ │ │ │ ├── bodyclose.go │ │ │ ├── bodyclose_integration_test.go │ │ │ └── testdata/ │ │ │ ├── bodyclose.go │ │ │ └── bodyclose_cgo.go │ │ ├── canonicalheader/ │ │ │ ├── canonicalheader.go │ │ │ ├── canonicalheader_test.go │ │ │ └── testdata/ │ │ │ ├── canonicalheader.go │ │ │ ├── canonicalheader_cgo.go │ │ │ └── fix/ │ │ │ ├── in/ │ │ │ │ └── canonicalheader.go │ │ │ └── out/ │ │ │ └── canonicalheader.go │ │ ├── containedctx/ │ │ │ ├── containedctx.go │ │ │ ├── containedctx_integration_test.go │ │ │ └── testdata/ │ │ │ ├── containedctx.go │ │ │ └── containedctx_cgo.go │ │ ├── contextcheck/ │ │ │ ├── contextcheck.go │ │ │ ├── contextcheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── contextcheck.go │ │ │ └── contextcheck_cgo.go │ │ ├── copyloopvar/ │ │ │ ├── copyloopvar.go │ │ │ ├── copyloopvar_integration_test.go │ │ │ └── testdata/ │ │ │ ├── copyloopvar.go │ │ │ ├── copyloopvar.yml │ │ │ ├── copyloopvar_cgo.go │ │ │ ├── copyloopvar_custom.go │ │ │ └── fix/ │ │ │ ├── in/ │ │ │ │ └── copyloopvar.go │ │ │ └── out/ │ │ │ └── copyloopvar.go │ │ ├── cyclop/ │ │ │ ├── cyclop.go │ │ │ ├── cyclop_integration_test.go │ │ │ └── testdata/ │ │ │ ├── cyclop.go │ │ │ ├── cyclop.yml │ │ │ └── cyclop_cgo.go │ │ ├── decorder/ │ │ │ ├── decorder.go │ │ │ ├── decorder_integration_test.go │ │ │ └── testdata/ │ │ │ ├── decorder.go │ │ │ ├── decorder_cgo.go │ │ │ ├── decorder_custom.go │ │ │ └── decorder_custom.yml │ │ ├── depguard/ │ │ │ ├── depguard.go │ │ │ ├── depguard_integration_test.go │ │ │ └── testdata/ │ │ │ ├── depguard.go │ │ │ ├── depguard.yml │ │ │ ├── depguard_additional_guards.go │ │ │ ├── depguard_additional_guards.yml │ │ │ ├── depguard_cgo.go │ │ │ ├── depguard_ignore_file_rules.go │ │ │ └── depguard_ignore_file_rules.yml │ │ ├── dogsled/ │ │ │ ├── dogsled.go │ │ │ ├── dogsled_integration_test.go │ │ │ └── testdata/ │ │ │ ├── dogsled.go │ │ │ └── dogsled_cgo.go │ │ ├── dupl/ │ │ │ ├── dupl.go │ │ │ ├── dupl_integration_test.go │ │ │ └── testdata/ │ │ │ ├── dupl.go │ │ │ ├── dupl.yml │ │ │ └── dupl_cgo.go │ │ ├── dupword/ │ │ │ ├── dupword.go │ │ │ ├── dupword_integration_test.go │ │ │ └── testdata/ │ │ │ ├── dupword.go │ │ │ ├── dupword_cgo.go │ │ │ ├── dupword_comments_only.go │ │ │ ├── dupword_comments_only.yml │ │ │ ├── dupword_ignore.go │ │ │ ├── dupword_ignore.yml │ │ │ └── fix/ │ │ │ ├── in/ │ │ │ │ └── dupword.go │ │ │ └── out/ │ │ │ └── dupword.go │ │ ├── durationcheck/ │ │ │ ├── durationcheck.go │ │ │ ├── durationcheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── durationcheck.go │ │ │ └── durationcheck_cgo.go │ │ ├── embeddedstructfieldcheck/ │ │ │ ├── embeddedstructfieldcheck.go │ │ │ ├── embeddedstructfieldcheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── embeddedstructfieldcheck_comments.go │ │ │ ├── embeddedstructfieldcheck_mutex.go │ │ │ ├── embeddedstructfieldcheck_mutex.yml │ │ │ ├── embeddedstructfieldcheck_simple.go │ │ │ ├── embeddedstructfieldcheck_special_cases.go │ │ │ └── fix/ │ │ │ ├── in/ │ │ │ │ ├── comments.go │ │ │ │ └── simple.go │ │ │ └── out/ │ │ │ ├── comments.go │ │ │ └── simple.go │ │ ├── err113/ │ │ │ ├── err113.go │ │ │ ├── err113_integration_test.go │ │ │ └── testdata/ │ │ │ ├── err113.go │ │ │ ├── err113_cgo.go │ │ │ └── fix/ │ │ │ ├── in/ │ │ │ │ └── err113.go │ │ │ └── out/ │ │ │ └── err113.go │ │ ├── errcheck/ │ │ │ ├── errcheck.go │ │ │ ├── errcheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── errcheck.go │ │ │ ├── errcheck_cgo.go │ │ │ ├── errcheck_exclude_functions.go │ │ │ ├── errcheck_exclude_functions.yml │ │ │ ├── errcheck_ignore_default.go │ │ │ ├── errcheck_ignore_default.yml │ │ │ ├── errcheck_type_assertions.go │ │ │ └── errcheck_type_assertions.yml │ │ ├── errchkjson/ │ │ │ ├── errchkjson.go │ │ │ ├── errchkjson_integration_test.go │ │ │ └── testdata/ │ │ │ ├── errchkjson.go │ │ │ ├── errchkjson.yml │ │ │ ├── errchkjson_cgo.go │ │ │ ├── errchkjson_check_error_free_encoding.go │ │ │ ├── errchkjson_check_error_free_encoding.yml │ │ │ ├── errchkjson_no_exported.go │ │ │ └── errchkjson_no_exported.yml │ │ ├── errname/ │ │ │ ├── errname.go │ │ │ ├── errname_integration_test.go │ │ │ └── testdata/ │ │ │ ├── errname.go │ │ │ └── errname_cgo.go │ │ ├── errorlint/ │ │ │ ├── errorlint.go │ │ │ ├── errorlint_integration_test.go │ │ │ └── testdata/ │ │ │ ├── errorlint.go │ │ │ ├── errorlint_asserts.go │ │ │ ├── errorlint_asserts.yml │ │ │ ├── errorlint_cgo.go │ │ │ ├── errorlint_comparison.go │ │ │ ├── errorlint_comparison.yml │ │ │ ├── errorlint_errorf.go │ │ │ ├── errorlint_errorf.yml │ │ │ └── fix/ │ │ │ ├── in/ │ │ │ │ └── errorlint.go │ │ │ └── out/ │ │ │ └── errorlint.go │ │ ├── exhaustive/ │ │ │ ├── exhaustive.go │ │ │ ├── exhaustive_integration_test.go │ │ │ └── testdata/ │ │ │ ├── exhaustive.go │ │ │ ├── exhaustive_cgo.go │ │ │ ├── exhaustive_default.go │ │ │ ├── exhaustive_default.yml │ │ │ ├── exhaustive_generated.go │ │ │ ├── exhaustive_ignore_enum_members.go │ │ │ └── exhaustive_ignore_enum_members.yml │ │ ├── exhaustruct/ │ │ │ ├── exhaustruct.go │ │ │ ├── exhaustruct_integration_test.go │ │ │ └── testdata/ │ │ │ ├── exhaustruct.go │ │ │ ├── exhaustruct_cgo.go │ │ │ ├── exhaustruct_custom.go │ │ │ └── exhaustruct_custom.yml │ │ ├── exptostd/ │ │ │ ├── exptostd.go │ │ │ ├── exptostd_integration_test.go │ │ │ └── testdata/ │ │ │ ├── exptostd.go │ │ │ ├── exptostd_cgo.go │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── exptostd.go │ │ │ │ └── out/ │ │ │ │ └── exptostd.go │ │ │ ├── go.mod │ │ │ └── go.sum │ │ ├── fatcontext/ │ │ │ ├── fatcontext.go │ │ │ ├── fatcontext_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fatcontext.go │ │ │ ├── fatcontext_cgo.go │ │ │ ├── fatcontext_structpointer.go │ │ │ ├── fatcontext_structpointer.yml │ │ │ └── fix/ │ │ │ ├── in/ │ │ │ │ └── fatcontext.go │ │ │ └── out/ │ │ │ └── fatcontext.go │ │ ├── forbidigo/ │ │ │ ├── forbidigo.go │ │ │ ├── forbidigo_integration_test.go │ │ │ └── testdata/ │ │ │ ├── forbidigo.yml │ │ │ ├── forbidigo_cgo.go │ │ │ ├── forbidigo_example.go │ │ │ ├── forbidigo_example_test.go │ │ │ ├── forbidigo_include_godoc_examples.yml │ │ │ ├── forbidigo_include_godoc_examples_test.go │ │ │ ├── forbidigo_struct.yml │ │ │ └── forbidigo_struct_config.go │ │ ├── forcetypeassert/ │ │ │ ├── forcetypeassert.go │ │ │ ├── forcetypeassert_integration_test.go │ │ │ └── testdata/ │ │ │ ├── forcetypeassert.go │ │ │ └── forcetypeassert_cgo.go │ │ ├── funcorder/ │ │ │ ├── funcorder.go │ │ │ ├── funcorder_integration_test.go │ │ │ └── testdata/ │ │ │ ├── funcorder.go │ │ │ ├── funcorder_disable_constructor.go │ │ │ ├── funcorder_disable_constructor.yml │ │ │ ├── funcorder_struct_method.go │ │ │ └── funcorder_struct_method.yml │ │ ├── funlen/ │ │ │ ├── funlen.go │ │ │ ├── funlen_integration_test.go │ │ │ └── testdata/ │ │ │ ├── funlen.go │ │ │ ├── funlen_cgo.go │ │ │ ├── funlen_custom.go │ │ │ ├── funlen_custom.yml │ │ │ ├── funlen_ignore_comments.go │ │ │ └── funlen_ignore_comments.yml │ │ ├── gci/ │ │ │ ├── gci.go │ │ │ ├── gci_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── gci.go │ │ │ │ └── out/ │ │ │ │ └── gci.go │ │ │ ├── gci.go │ │ │ ├── gci.yml │ │ │ ├── gci_cgo.go │ │ │ ├── gci_go124.go │ │ │ └── gci_go124.yml │ │ ├── ginkgolinter/ │ │ │ ├── ginkgolinter.go │ │ │ ├── ginkgolinter_integration_test.go │ │ │ └── testdata/ │ │ │ ├── ginkgolinter.go │ │ │ ├── ginkgolinter_allow_havelen0.yml │ │ │ ├── ginkgolinter_cgo.go │ │ │ ├── ginkgolinter_default.yml │ │ │ ├── ginkgolinter_havelen0.go │ │ │ ├── ginkgolinter_suppress_async.go │ │ │ ├── ginkgolinter_suppress_async.yml │ │ │ ├── ginkgolinter_suppress_compare.go │ │ │ ├── ginkgolinter_suppress_compare.yml │ │ │ ├── ginkgolinter_suppress_err.go │ │ │ ├── ginkgolinter_suppress_err.yml │ │ │ ├── ginkgolinter_suppress_focused_containers.go │ │ │ ├── ginkgolinter_suppress_focused_containers.yml │ │ │ ├── ginkgolinter_suppress_len.go │ │ │ ├── ginkgolinter_suppress_len.yml │ │ │ ├── ginkgolinter_suppress_nil.go │ │ │ ├── ginkgolinter_suppress_nil.yml │ │ │ ├── go.mod │ │ │ └── go.sum │ │ ├── gocheckcompilerdirectives/ │ │ │ ├── gocheckcompilerdirectives.go │ │ │ ├── gocheckcompilerdirectives_integration_test.go │ │ │ └── testdata/ │ │ │ ├── gocheckcompilerdirectives.go │ │ │ └── gocheckcompilerdirectives_cgo.go │ │ ├── gochecknoglobals/ │ │ │ ├── gochecknoglobals.go │ │ │ ├── gochecknoglobals_integration_test.go │ │ │ └── testdata/ │ │ │ ├── gochecknoglobals.go │ │ │ └── gochecknoglobals_cgo.go │ │ ├── gochecknoinits/ │ │ │ ├── gochecknoinits.go │ │ │ ├── gochecknoinits_integration_test.go │ │ │ └── testdata/ │ │ │ ├── gochecknoinits.go │ │ │ └── gochecknoinits_cgo.go │ │ ├── gochecksumtype/ │ │ │ ├── gochecksumtype.go │ │ │ ├── gochecksumtype_integration_test.go │ │ │ └── testdata/ │ │ │ ├── gochecksumtype.go │ │ │ ├── gochecksumtype_cgo.go │ │ │ ├── gochecksumtype_custom.go │ │ │ └── gochecksumtype_custom.yml │ │ ├── gocognit/ │ │ │ ├── gocognit.go │ │ │ ├── gocognit_integration_test.go │ │ │ └── testdata/ │ │ │ ├── gocognit.go │ │ │ ├── gocognit.yml │ │ │ └── gocognit_cgo.go │ │ ├── goconst/ │ │ │ ├── goconst.go │ │ │ ├── goconst_integration_test.go │ │ │ └── testdata/ │ │ │ ├── goconst.go │ │ │ ├── goconst_calls_enabled.go │ │ │ ├── goconst_calls_enabled.yml │ │ │ ├── goconst_cgo.go │ │ │ ├── goconst_dont_ignore_test.go │ │ │ ├── goconst_eval_and_find_duplicates.go │ │ │ ├── goconst_eval_and_find_duplicates.yml │ │ │ ├── goconst_eval_const_expressions.go │ │ │ ├── goconst_eval_const_expressions.yml │ │ │ ├── goconst_find_duplicates.go │ │ │ └── goconst_find_duplicates.yml │ │ ├── gocritic/ │ │ │ ├── gocritic.go │ │ │ ├── gocritic_integration_test.go │ │ │ ├── gocritic_settings.go │ │ │ ├── gocritic_settings_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── gocritic.go │ │ │ │ └── out/ │ │ │ │ └── gocritic.go │ │ │ ├── gocritic-fix.yml │ │ │ ├── gocritic.go │ │ │ ├── gocritic.yml │ │ │ ├── gocritic_cgo.go │ │ │ ├── gocritic_importShadow.go │ │ │ ├── gocritic_inportShadow.yml │ │ │ └── ruleguard/ │ │ │ ├── README.md │ │ │ ├── preferWriteString.go │ │ │ ├── rangeExprCopy.go │ │ │ └── stringsSimplify.go │ │ ├── gocyclo/ │ │ │ ├── gocyclo.go │ │ │ ├── gocyclo_integration_test.go │ │ │ └── testdata/ │ │ │ ├── gocyclo.go │ │ │ ├── gocyclo.yml │ │ │ └── gocyclo_cgo.go │ │ ├── godoclint/ │ │ │ ├── godoclint.go │ │ │ ├── godoclint_integration_test.go │ │ │ └── testdata/ │ │ │ ├── godoclint.yml │ │ │ ├── godoclint_default_fail.go │ │ │ ├── godoclint_default_pass.go │ │ │ ├── godoclint_full_fail.go │ │ │ ├── godoclint_full_pass.go │ │ │ └── godoclint_full_pass_test.go │ │ ├── godot/ │ │ │ ├── godot.go │ │ │ ├── godot_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── godot.go │ │ │ │ └── out/ │ │ │ │ └── godot.go │ │ │ ├── godot.go │ │ │ └── godot_cgo.go │ │ ├── godox/ │ │ │ ├── godox.go │ │ │ ├── godox_integration_test.go │ │ │ └── testdata/ │ │ │ ├── godox.go │ │ │ ├── godox.yml │ │ │ └── godox_cgo.go │ │ ├── gofmt/ │ │ │ ├── gofmt.go │ │ │ ├── gofmt_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ ├── gofmt.go │ │ │ │ │ └── gofmt_rewrite_rules.go │ │ │ │ └── out/ │ │ │ │ ├── gofmt.go │ │ │ │ └── gofmt_rewrite_rules.go │ │ │ ├── gofmt.go │ │ │ ├── gofmt.yml │ │ │ ├── gofmt_cgo.go │ │ │ ├── gofmt_no_simplify.go │ │ │ ├── gofmt_no_simplify.yml │ │ │ ├── gofmt_rewrite_rules.go │ │ │ ├── gofmt_rewrite_rules.yml │ │ │ └── gofmt_too_many_empty_lines.go │ │ ├── gofumpt/ │ │ │ ├── gofumpt.go │ │ │ ├── gofumpt_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ ├── gofumpt.go │ │ │ │ │ └── gofumpt_cgo.go │ │ │ │ └── out/ │ │ │ │ ├── gofumpt.go │ │ │ │ └── gofumpt_cgo.go │ │ │ ├── gofumpt-fix.yml │ │ │ ├── gofumpt.go │ │ │ ├── gofumpt.yml │ │ │ ├── gofumpt_cgo.go │ │ │ ├── gofumpt_too_many_empty_lines.go │ │ │ ├── gofumpt_with_extra.go │ │ │ └── gofumpt_with_extra.yml │ │ ├── goheader/ │ │ │ ├── goheader.go │ │ │ ├── goheader_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ ├── goheader_1.go │ │ │ │ │ ├── goheader_2.go │ │ │ │ │ ├── goheader_3.go │ │ │ │ │ └── goheader_4.go │ │ │ │ └── out/ │ │ │ │ ├── goheader_1.go │ │ │ │ ├── goheader_2.go │ │ │ │ ├── goheader_3.go │ │ │ │ └── goheader_4.go │ │ │ ├── goheader-fix.yml │ │ │ ├── goheader.yml │ │ │ ├── goheader_bad.go │ │ │ ├── goheader_cgo.go │ │ │ └── goheader_good.go │ │ ├── goimports/ │ │ │ ├── goimports.go │ │ │ ├── goimports_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ ├── goimports.go │ │ │ │ │ └── goimports_cgo.go │ │ │ │ └── out/ │ │ │ │ ├── goimports.go │ │ │ │ └── goimports_cgo.go │ │ │ ├── goimports.go │ │ │ ├── goimports.yml │ │ │ ├── goimports_cgo.go │ │ │ ├── goimports_local.go │ │ │ └── goimports_local.yml │ │ ├── golines/ │ │ │ ├── golines.go │ │ │ ├── golines_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ ├── golines-custom.go │ │ │ │ │ └── golines.go │ │ │ │ └── out/ │ │ │ │ ├── golines-custom.go │ │ │ │ └── golines.go │ │ │ ├── golines-custom.yml │ │ │ ├── golines.go │ │ │ └── golines.yml │ │ ├── gomoddirectives/ │ │ │ └── gomoddirectives.go │ │ ├── gomodguard/ │ │ │ ├── gomodguard.go │ │ │ ├── gomodguard_integration_test.go │ │ │ └── testdata/ │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── gomodguard.go │ │ │ ├── gomodguard.yml │ │ │ └── gomodguard_cgo.go │ │ ├── goprintffuncname/ │ │ │ ├── goprintffuncname.go │ │ │ ├── goprintffuncname_integration_test.go │ │ │ └── testdata/ │ │ │ ├── goprintffuncname.go │ │ │ └── goprintffuncname_cgo.go │ │ ├── gosec/ │ │ │ ├── gosec.go │ │ │ ├── gosec_integration_test.go │ │ │ ├── gosec_test.go │ │ │ └── testdata/ │ │ │ ├── gosec.go │ │ │ ├── gosec.yml │ │ │ ├── gosec_cgo.go │ │ │ ├── gosec_global_option.go │ │ │ ├── gosec_global_option.yml │ │ │ ├── gosec_nosec.go │ │ │ ├── gosec_nosec.yml │ │ │ ├── gosec_rules_config.go │ │ │ ├── gosec_severity_confidence.go │ │ │ └── gosec_severity_confidence.yml │ │ ├── gosmopolitan/ │ │ │ ├── gosmopolitan.go │ │ │ ├── gosmopolitan_integration_test.go │ │ │ └── testdata/ │ │ │ ├── gosmopolitan.go │ │ │ ├── gosmopolitan_allow_time_local.go │ │ │ ├── gosmopolitan_allow_time_local.yml │ │ │ ├── gosmopolitan_cgo.go │ │ │ ├── gosmopolitan_dont_ignore_test.go │ │ │ ├── gosmopolitan_escape_hatches.go │ │ │ ├── gosmopolitan_escape_hatches.yml │ │ │ ├── gosmopolitan_scripts.go │ │ │ └── gosmopolitan_scripts.yml │ │ ├── govet/ │ │ │ ├── govet.go │ │ │ ├── govet_integration_test.go │ │ │ ├── govet_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── govet.go │ │ │ │ └── out/ │ │ │ │ └── govet.go │ │ │ ├── govet.go │ │ │ ├── govet.yml │ │ │ ├── govet_cgo.go │ │ │ ├── govet_custom_formatter.go │ │ │ ├── govet_fieldalignment.go │ │ │ ├── govet_fieldalignment.yml │ │ │ ├── govet_fix.yml │ │ │ ├── govet_ifaceassert.go │ │ │ └── govet_ifaceassert.yml │ │ ├── grouper/ │ │ │ ├── grouper.go │ │ │ ├── grouper_integration_test.go │ │ │ └── testdata/ │ │ │ ├── grouper.go │ │ │ ├── grouper.yml │ │ │ └── grouper_cgo.go │ │ ├── iface/ │ │ │ ├── iface.go │ │ │ ├── iface_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── iface.go │ │ │ │ └── out/ │ │ │ │ └── iface.go │ │ │ ├── iface_all.go │ │ │ ├── iface_all.yml │ │ │ ├── iface_cgo.go │ │ │ ├── iface_default.go │ │ │ ├── iface_fix.yml │ │ │ ├── iface_identical.go │ │ │ ├── iface_identical.yml │ │ │ ├── iface_opaque.go │ │ │ ├── iface_opaque.yml │ │ │ ├── iface_unexported.go │ │ │ ├── iface_unexported.yml │ │ │ ├── iface_unused.go │ │ │ └── iface_unused.yml │ │ ├── importas/ │ │ │ ├── importas.go │ │ │ ├── importas_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── importas.go │ │ │ │ └── out/ │ │ │ │ └── importas.go │ │ │ ├── importas.go │ │ │ ├── importas.yml │ │ │ ├── importas_cgo.go │ │ │ ├── importas_several_empty_aliases.go │ │ │ ├── importas_several_empty_aliases.yml │ │ │ ├── importas_strict.go │ │ │ └── importas_strict.yml │ │ ├── inamedparam/ │ │ │ ├── inamedparam.go │ │ │ ├── inamedparam_integration_test.go │ │ │ └── testdata/ │ │ │ ├── inamedparam.go │ │ │ ├── inamedparam_cgo.go │ │ │ ├── inamedparam_skip_single_param.go │ │ │ └── inamedparam_skip_single_param.yml │ │ ├── ineffassign/ │ │ │ ├── ineffassign.go │ │ │ ├── ineffassign_integration_test.go │ │ │ └── testdata/ │ │ │ ├── ineffassign.go │ │ │ └── ineffassign_cgo.go │ │ ├── interfacebloat/ │ │ │ ├── interfacebloat.go │ │ │ ├── interfacebloat_integration_test.go │ │ │ └── testdata/ │ │ │ ├── interfacebloat.go │ │ │ └── interfacebloat_cgo.go │ │ ├── internal/ │ │ │ ├── commons.go │ │ │ └── util.go │ │ ├── intrange/ │ │ │ ├── intrange.go │ │ │ ├── intrange_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── intrange.go │ │ │ │ └── out/ │ │ │ │ └── intrange.go │ │ │ ├── intrange.go │ │ │ └── intrange_cgo.go │ │ ├── iotamixing/ │ │ │ ├── iotamixing.go │ │ │ ├── iotamixing_integration_test.go │ │ │ └── testdata/ │ │ │ ├── iotamixing.go │ │ │ ├── iotamixing_report-individual.go │ │ │ └── iotamixing_report-individual.yml │ │ ├── ireturn/ │ │ │ ├── ireturn.go │ │ │ ├── ireturn_integration_test.go │ │ │ └── testdata/ │ │ │ ├── ireturn.go │ │ │ ├── ireturn_allow.go │ │ │ ├── ireturn_allow.yml │ │ │ ├── ireturn_cgo.go │ │ │ ├── ireturn_reject_generics.go │ │ │ ├── ireturn_reject_generics.yml │ │ │ ├── ireturn_reject_stdlib.go │ │ │ └── ireturn_reject_stdlib.yml │ │ ├── lll/ │ │ │ ├── lll.go │ │ │ ├── lll_integration_test.go │ │ │ └── testdata/ │ │ │ ├── lll.go │ │ │ ├── lll.yml │ │ │ ├── lll_cgo.go │ │ │ ├── lll_import.yml │ │ │ ├── lll_import_multi.go │ │ │ ├── lll_import_single.go │ │ │ ├── lll_max_scan_token_size.go │ │ │ └── lll_max_scan_token_size_cgo.go │ │ ├── loggercheck/ │ │ │ ├── loggercheck.go │ │ │ ├── loggercheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── loggercheck_cgo.go │ │ │ ├── loggercheck_custom.go │ │ │ ├── loggercheck_custom.yml │ │ │ ├── loggercheck_default.go │ │ │ ├── loggercheck_kitlogonly.go │ │ │ ├── loggercheck_kitlogonly.yml │ │ │ ├── loggercheck_logronly.go │ │ │ ├── loggercheck_logronly.yml │ │ │ ├── loggercheck_noprintflike.go │ │ │ ├── loggercheck_noprintflike.yml │ │ │ ├── loggercheck_requirestringkey.go │ │ │ ├── loggercheck_requirestringkey.yml │ │ │ ├── loggercheck_slogonly.go │ │ │ ├── loggercheck_slogonly.yml │ │ │ ├── loggercheck_zaponly.go │ │ │ └── loggercheck_zaponly.yml │ │ ├── maintidx/ │ │ │ ├── maintidx.go │ │ │ ├── maintidx_integration_test.go │ │ │ └── testdata/ │ │ │ ├── maintidx.go │ │ │ ├── maintidx_cgo.go │ │ │ ├── maintidx_under_100.go │ │ │ └── maintidx_under_100.yml │ │ ├── makezero/ │ │ │ ├── makezero.go │ │ │ ├── makezero_integration_test.go │ │ │ └── testdata/ │ │ │ ├── makezero.go │ │ │ ├── makezero_always.go │ │ │ ├── makezero_always.yml │ │ │ └── makezero_cgo.go │ │ ├── mirror/ │ │ │ ├── mirror.go │ │ │ ├── mirror_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── mirror.go │ │ │ │ └── out/ │ │ │ │ └── mirror.go │ │ │ ├── mirror.go │ │ │ └── mirror_cgo.go │ │ ├── misspell/ │ │ │ ├── misspell.go │ │ │ ├── misspell_integration_test.go │ │ │ ├── misspell_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── misspell.go │ │ │ │ └── out/ │ │ │ │ └── misspell.go │ │ │ ├── misspell.go │ │ │ ├── misspell.yml │ │ │ ├── misspell_cgo.go │ │ │ ├── misspell_custom.go │ │ │ └── misspell_custom.yml │ │ ├── mnd/ │ │ │ ├── mnd.go │ │ │ ├── mnd_integration_test.go │ │ │ └── testdata/ │ │ │ ├── mnd.go │ │ │ ├── mnd_cgo.go │ │ │ ├── mnd_custom.go │ │ │ └── mnd_custom.yml │ │ ├── modernize/ │ │ │ ├── modernize.go │ │ │ ├── modernize_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ ├── any.go │ │ │ │ │ ├── fieldsseq.go │ │ │ │ │ ├── fmtappendf.go │ │ │ │ │ ├── forvar.go │ │ │ │ │ ├── mapsloop.go │ │ │ │ │ ├── mapsloop_dot.go │ │ │ │ │ ├── minmax.go │ │ │ │ │ ├── rangeint.go │ │ │ │ │ ├── reflecttypefor.go │ │ │ │ │ ├── slicescontains.go │ │ │ │ │ ├── slicessort.go │ │ │ │ │ ├── splitseq.go │ │ │ │ │ ├── stditerators.go │ │ │ │ │ ├── stringsbuilder.go │ │ │ │ │ ├── stringscutprefix.go │ │ │ │ │ ├── testingcontext_test.go │ │ │ │ │ └── waitgroup.go │ │ │ │ └── out/ │ │ │ │ ├── any.go │ │ │ │ ├── fieldsseq.go │ │ │ │ ├── fmtappendf.go │ │ │ │ ├── forvar.go │ │ │ │ ├── mapsloop.go │ │ │ │ ├── mapsloop_dot.go │ │ │ │ ├── minmax.go │ │ │ │ ├── rangeint.go │ │ │ │ ├── reflecttypefor.go │ │ │ │ ├── slicescontains.go │ │ │ │ ├── slicessort.go │ │ │ │ ├── splitseq.go │ │ │ │ ├── stditerators.go │ │ │ │ ├── stringsbuilder.go │ │ │ │ ├── stringscutprefix.go │ │ │ │ ├── testingcontext_test.go │ │ │ │ └── waitgroup.go │ │ │ ├── modernize_any.go │ │ │ ├── modernize_custom.go │ │ │ └── modernize_custom.yml │ │ ├── musttag/ │ │ │ ├── musttag.go │ │ │ ├── musttag_integration_test.go │ │ │ └── testdata/ │ │ │ ├── musttag.go │ │ │ ├── musttag.yml │ │ │ ├── musttag_cgo.go │ │ │ └── musttag_custom.go │ │ ├── nakedret/ │ │ │ ├── nakedret.go │ │ │ ├── nakedret_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── nakedret.go │ │ │ │ └── out/ │ │ │ │ └── nakedret.go │ │ │ ├── nakedret.go │ │ │ └── nakedret_cgo.go │ │ ├── nestif/ │ │ │ ├── nestif.go │ │ │ ├── nestif_integration_test.go │ │ │ └── testdata/ │ │ │ ├── nestif.go │ │ │ ├── nestif.yml │ │ │ └── nestif_cgo.go │ │ ├── nilerr/ │ │ │ ├── nilerr.go │ │ │ ├── nilerr_integration_test.go │ │ │ └── testdata/ │ │ │ ├── nilerr.go │ │ │ └── nilerr_cgo.go │ │ ├── nilnesserr/ │ │ │ ├── nilnesserr.go │ │ │ ├── nilnesserr_integration_test.go │ │ │ └── testdata/ │ │ │ ├── nilnesserr.go │ │ │ └── nilnesserr_cgo.go │ │ ├── nilnil/ │ │ │ ├── nilnil.go │ │ │ ├── nilnil_integration_test.go │ │ │ └── testdata/ │ │ │ ├── nilnil.go │ │ │ ├── nilnil_cgo.go │ │ │ ├── nilnil_detect_opposite.go │ │ │ ├── nilnil_detect_opposite.yml │ │ │ ├── nilnil_multiple_nils.go │ │ │ ├── nilnil_multiple_nils.yml │ │ │ ├── nilnil_pointers_only.go │ │ │ └── nilnil_pointers_only.yml │ │ ├── nlreturn/ │ │ │ ├── nlreturn.go │ │ │ ├── nlreturn_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── nlreturn.go │ │ │ │ └── out/ │ │ │ │ └── nlreturn.go │ │ │ ├── nlreturn-block-size.go │ │ │ ├── nlreturn-block-size.yml │ │ │ ├── nlreturn.go │ │ │ └── nlreturn_cgo.go │ │ ├── noctx/ │ │ │ ├── noctx.go │ │ │ ├── noctx_integration_test.go │ │ │ └── testdata/ │ │ │ ├── noctx.go │ │ │ └── noctx_cgo.go │ │ ├── noinlineerr/ │ │ │ ├── noinlineerr.go │ │ │ ├── noinlineerr_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── noinlineerr.go │ │ │ │ └── out/ │ │ │ │ └── noinlineerr.go │ │ │ └── noinlineerr.go │ │ ├── nolintlint/ │ │ │ ├── internal/ │ │ │ │ ├── README.md │ │ │ │ ├── issues.go │ │ │ │ ├── nolintlint.go │ │ │ │ └── nolintlint_test.go │ │ │ ├── nolintlint.go │ │ │ ├── nolintlint_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── nolintlint.go │ │ │ │ └── out/ │ │ │ │ └── nolintlint.go │ │ │ ├── nolintlint.go │ │ │ ├── nolintlint.yml │ │ │ ├── nolintlint_cgo.go │ │ │ ├── nolintlint_unused.go │ │ │ └── nolintlint_unused.yml │ │ ├── nonamedreturns/ │ │ │ ├── nonamedreturns.go │ │ │ ├── nonamedreturns_integration_test.go │ │ │ └── testdata/ │ │ │ ├── nonamedreturns.go │ │ │ ├── nonamedreturns_cgo.go │ │ │ ├── nonamedreturns_custom.go │ │ │ └── nonamedreturns_custom.yml │ │ ├── nosprintfhostport/ │ │ │ ├── nosprintfhostport.go │ │ │ ├── nosprintfhostport_integration_test.go │ │ │ └── testdata/ │ │ │ ├── nosprintfhostport.go │ │ │ └── nosprintfhostport_cgo.go │ │ ├── paralleltest/ │ │ │ ├── paralleltest.go │ │ │ ├── paralleltest_integration_test.go │ │ │ └── testdata/ │ │ │ ├── paralleltest_custom_test.go │ │ │ ├── paralleltest_custom_test.yml │ │ │ └── paralleltest_test.go │ │ ├── perfsprint/ │ │ │ ├── perfsprint.go │ │ │ ├── perfsprint_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── perfsprint.go │ │ │ │ └── out/ │ │ │ │ └── perfsprint.go │ │ │ ├── perfsprint.go │ │ │ ├── perfsprint_cgo.go │ │ │ ├── perfsprint_custom.go │ │ │ └── perfsprint_custom.yml │ │ ├── prealloc/ │ │ │ ├── prealloc.go │ │ │ ├── prealloc_integration_test.go │ │ │ └── testdata/ │ │ │ ├── prealloc.go │ │ │ └── prealloc_cgo.go │ │ ├── predeclared/ │ │ │ ├── predeclared.go │ │ │ ├── predeclared_integration_test.go │ │ │ └── testdata/ │ │ │ ├── predeclared.go │ │ │ ├── predeclared_cgo.go │ │ │ ├── predeclared_custom.go │ │ │ └── predeclared_custom.yml │ │ ├── promlinter/ │ │ │ ├── promlinter.go │ │ │ ├── promlinter_integration_test.go │ │ │ └── testdata/ │ │ │ ├── promlinter.go │ │ │ └── promlinter_cgo.go │ │ ├── protogetter/ │ │ │ ├── protogetter.go │ │ │ ├── protogetter_integration_test.go │ │ │ └── testdata/ │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── proto/ │ │ │ │ ├── test.go │ │ │ │ ├── test.pb.go │ │ │ │ ├── test.proto │ │ │ │ └── test_grpc.pb.go │ │ │ ├── protogetter.go │ │ │ └── protogetter_cgo.go │ │ ├── reassign/ │ │ │ ├── reassign.go │ │ │ ├── reassign_integration_test.go │ │ │ └── testdata/ │ │ │ ├── reassign.go │ │ │ ├── reassign_cgo.go │ │ │ ├── reassign_patterns.go │ │ │ └── reassign_patterns.yml │ │ ├── recvcheck/ │ │ │ ├── recvcheck.go │ │ │ ├── recvcheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── recvcheck.go │ │ │ └── recvcheck_cgo.go │ │ ├── revive/ │ │ │ ├── revive.go │ │ │ ├── revive_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── revive.go │ │ │ │ └── out/ │ │ │ │ └── revive.go │ │ │ ├── revive-fix.yml │ │ │ ├── revive.go │ │ │ ├── revive.yml │ │ │ ├── revive_cgo.go │ │ │ └── revive_default.go │ │ ├── rowserrcheck/ │ │ │ ├── rowserrcheck.go │ │ │ ├── rowserrcheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── rowserrcheck.go │ │ │ └── rowserrcheck_cgo.go │ │ ├── sloglint/ │ │ │ ├── sloglint.go │ │ │ ├── sloglint_integration_test.go │ │ │ └── testdata/ │ │ │ ├── sloglint.go │ │ │ ├── sloglint_args_on_sep_lines.go │ │ │ ├── sloglint_args_on_sep_lines.yml │ │ │ ├── sloglint_attr_only.go │ │ │ ├── sloglint_attr_only.yml │ │ │ ├── sloglint_cgo.go │ │ │ ├── sloglint_context_only.go │ │ │ ├── sloglint_context_only.yml │ │ │ ├── sloglint_forbidden_keys.go │ │ │ ├── sloglint_forbidden_keys.yml │ │ │ ├── sloglint_key_naming_case.go │ │ │ ├── sloglint_key_naming_case.yml │ │ │ ├── sloglint_kv_only.go │ │ │ ├── sloglint_kv_only.yml │ │ │ ├── sloglint_no_raw_keys.go │ │ │ ├── sloglint_no_raw_keys.yml │ │ │ ├── sloglint_static_msg.go │ │ │ └── sloglint_static_msg.yml │ │ ├── spancheck/ │ │ │ ├── spancheck.go │ │ │ ├── spancheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── spancheck.go │ │ │ ├── spancheck_cgo.go │ │ │ ├── spancheck_enable_all.go │ │ │ ├── spancheck_enable_all.yml │ │ │ ├── spancheck_keep_default.go │ │ │ └── spancheck_keep_default.yml │ │ ├── sqlclosecheck/ │ │ │ ├── sqlclosecheck.go │ │ │ ├── sqlclosecheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── sqlclosecheck.go │ │ │ └── sqlclosecheck_cgo.go │ │ ├── staticcheck/ │ │ │ ├── staticcheck.go │ │ │ ├── staticcheck_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ ├── gosimple.go │ │ │ │ │ ├── staticcheck.go │ │ │ │ │ └── stylecheck.go │ │ │ │ └── out/ │ │ │ │ ├── gosimple.go │ │ │ │ ├── staticcheck.go │ │ │ │ └── stylecheck.go │ │ │ ├── gosimple.go │ │ │ ├── gosimple.yml │ │ │ ├── gosimple_cgo.go │ │ │ ├── staticcheck.go │ │ │ ├── staticcheck.yml │ │ │ ├── staticcheck_cgo.go │ │ │ ├── stylecheck.go │ │ │ ├── stylecheck.yml │ │ │ ├── stylecheck_cgo.go │ │ │ ├── stylecheck_empty.go │ │ │ ├── stylecheck_empty.yml │ │ │ ├── stylecheck_nil.go │ │ │ └── stylecheck_nil.yml │ │ ├── swaggo/ │ │ │ ├── swaggo.go │ │ │ ├── swaggo_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── swaggo.go │ │ │ │ └── out/ │ │ │ │ └── swaggo.go │ │ │ ├── swaggo.go │ │ │ └── swaggo.yml │ │ ├── tagalign/ │ │ │ ├── tagalign.go │ │ │ ├── tagalign_integration_test.go │ │ │ └── testdata/ │ │ │ ├── fix/ │ │ │ │ ├── in/ │ │ │ │ │ └── tagalign.go │ │ │ │ └── out/ │ │ │ │ └── tagalign.go │ │ │ ├── tagalign.go │ │ │ ├── tagalign_align_only.go │ │ │ ├── tagalign_align_only.yml │ │ │ ├── tagalign_cgo.go │ │ │ ├── tagalign_order_only.go │ │ │ ├── tagalign_order_only.yml │ │ │ ├── tagalign_sort_only.go │ │ │ ├── tagalign_sort_only.yml │ │ │ ├── tagalign_strict.go │ │ │ └── tagalign_strict.yml │ │ ├── tagliatelle/ │ │ │ ├── tagliatelle.go │ │ │ ├── tagliatelle_integration_test.go │ │ │ └── testdata/ │ │ │ ├── tagliatelle.go │ │ │ ├── tagliatelle_cgo.go │ │ │ ├── tagliatelle_ignored_fields.go │ │ │ ├── tagliatelle_ignored_fields.yml │ │ │ ├── tagliatelle_initialism_overrides.go │ │ │ └── tagliatelle_initialism_overrides.yml │ │ ├── testableexamples/ │ │ │ ├── testableexamples.go │ │ │ ├── testableexamples_integration_test.go │ │ │ └── testdata/ │ │ │ ├── testableexamples_test.go │ │ │ └── testableexamples_test_cgo.go │ │ ├── testifylint/ │ │ │ ├── testdata/ │ │ │ │ ├── fix/ │ │ │ │ │ ├── in/ │ │ │ │ │ │ └── testifylint.go │ │ │ │ │ └── out/ │ │ │ │ │ └── testifylint.go │ │ │ │ ├── testifylint.go │ │ │ │ ├── testifylint_bool_compare_only.go │ │ │ │ ├── testifylint_bool_compare_only.yml │ │ │ │ ├── testifylint_cgo.go │ │ │ │ ├── testifylint_formatter_dont_require_string_msg.go │ │ │ │ ├── testifylint_formatter_dont_require_string_msg.yml │ │ │ │ ├── testifylint_formatter_only.go │ │ │ │ ├── testifylint_formatter_only.yml │ │ │ │ ├── testifylint_require_error_only.go │ │ │ │ └── testifylint_require_error_only.yml │ │ │ ├── testifylint.go │ │ │ └── testifylint_integration_test.go │ │ ├── testpackage/ │ │ │ ├── testdata/ │ │ │ │ └── testpackage_test.go │ │ │ ├── testpackage.go │ │ │ └── testpackage_integration_test.go │ │ ├── thelper/ │ │ │ ├── testdata/ │ │ │ │ ├── thelper.go │ │ │ │ ├── thelper.yml │ │ │ │ ├── thelper_cgo.go │ │ │ │ ├── thelper_fuzz.go │ │ │ │ └── thelper_with_options.go │ │ │ ├── thelper.go │ │ │ └── thelper_integration_test.go │ │ ├── tparallel/ │ │ │ ├── testdata/ │ │ │ │ ├── tparallel_cgo.go │ │ │ │ ├── tparallel_happy_path_test.go │ │ │ │ ├── tparallel_missing_subtest_test.go │ │ │ │ └── tparallel_missing_toplevel_test.go │ │ │ ├── tparallel.go │ │ │ └── tparallel_integration_test.go │ │ ├── typecheck.go │ │ ├── unconvert/ │ │ │ ├── testdata/ │ │ │ │ ├── unconvert.go │ │ │ │ └── unconvert_cgo.go │ │ │ ├── unconvert.go │ │ │ └── unconvert_integration_test.go │ │ ├── unparam/ │ │ │ ├── testdata/ │ │ │ │ ├── unparam.go │ │ │ │ └── unparam_cgo.go │ │ │ ├── unparam.go │ │ │ └── unparam_integration_test.go │ │ ├── unqueryvet/ │ │ │ ├── testdata/ │ │ │ │ ├── unqueryvet.go │ │ │ │ ├── unqueryvet_custom.go │ │ │ │ └── unqueryvet_custom.yml │ │ │ ├── unqueryvet.go │ │ │ └── unqueryvet_integration_test.go │ │ ├── unused/ │ │ │ ├── testdata/ │ │ │ │ ├── unused.go │ │ │ │ └── unused_cgo.go │ │ │ ├── unused.go │ │ │ └── unused_integration_test.go │ │ ├── usestdlibvars/ │ │ │ ├── testdata/ │ │ │ │ ├── fix/ │ │ │ │ │ ├── in/ │ │ │ │ │ │ └── usestdlibvars.go │ │ │ │ │ └── out/ │ │ │ │ │ └── usestdlibvars.go │ │ │ │ ├── usestdlibvars.go │ │ │ │ ├── usestdlibvars_cgo.go │ │ │ │ ├── usestdlibvars_non_default.go │ │ │ │ └── usestdlibvars_non_default.yml │ │ │ ├── usestdlibvars.go │ │ │ └── usestdlibvars_integration_test.go │ │ ├── usetesting/ │ │ │ ├── testdata/ │ │ │ │ ├── fix/ │ │ │ │ │ ├── in/ │ │ │ │ │ │ └── usetesting.go │ │ │ │ │ └── out/ │ │ │ │ │ └── usetesting.go │ │ │ │ ├── usetesting.go │ │ │ │ ├── usetesting_cgo.go │ │ │ │ ├── usetesting_configuration.go │ │ │ │ └── usetesting_configuration.yml │ │ │ ├── usetesting.go │ │ │ └── usetesting_integration_test.go │ │ ├── varnamelen/ │ │ │ ├── testdata/ │ │ │ │ ├── varnamelen.go │ │ │ │ ├── varnamelen_cgo.go │ │ │ │ ├── varnamelen_configuration.go │ │ │ │ └── varnamelen_configuration.yml │ │ │ ├── varnamelen.go │ │ │ └── varnamelen_integration_test.go │ │ ├── wastedassign/ │ │ │ ├── testdata/ │ │ │ │ ├── wastedassign.go │ │ │ │ └── wastedassign_cgo.go │ │ │ ├── wastedassign.go │ │ │ └── wastedassign_integration_test.go │ │ ├── whitespace/ │ │ │ ├── testdata/ │ │ │ │ ├── fix/ │ │ │ │ │ ├── in/ │ │ │ │ │ │ └── whitespace.go │ │ │ │ │ └── out/ │ │ │ │ │ └── whitespace.go │ │ │ │ ├── whitespace-fix.yml │ │ │ │ ├── whitespace.go │ │ │ │ ├── whitespace.yml │ │ │ │ └── whitespace_cgo.go │ │ │ ├── whitespace.go │ │ │ └── whitespace_integration_test.go │ │ ├── wrapcheck/ │ │ │ ├── testdata/ │ │ │ │ ├── wrapcheck.go │ │ │ │ └── wrapcheck_cgo.go │ │ │ ├── wrapcheck.go │ │ │ └── wrapcheck_integration_test.go │ │ ├── wsl/ │ │ │ ├── testdata/ │ │ │ │ ├── fix/ │ │ │ │ │ ├── in/ │ │ │ │ │ │ ├── wsl_v4.go │ │ │ │ │ │ └── wsl_v5.go │ │ │ │ │ └── out/ │ │ │ │ │ ├── wsl_v4.go │ │ │ │ │ └── wsl_v5.go │ │ │ │ ├── ws_v4_cgo.go │ │ │ │ ├── wsl_v4.go │ │ │ │ ├── wsl_v4.yml │ │ │ │ ├── wsl_v5.go │ │ │ │ ├── wsl_v5_config.go │ │ │ │ └── wsl_v5_config.yml │ │ │ ├── wsl.go │ │ │ ├── wsl_integration_test.go │ │ │ └── wsl_v5.go │ │ └── zerologlint/ │ │ ├── testdata/ │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── zerologlint.go │ │ │ └── zerologlint_cgo.go │ │ ├── zerologlint.go │ │ └── zerologlint_integration_test.go │ ├── goutil/ │ │ ├── env.go │ │ ├── version.go │ │ └── version_test.go │ ├── lint/ │ │ ├── context.go │ │ ├── linter/ │ │ │ ├── config.go │ │ │ ├── context.go │ │ │ └── linter.go │ │ ├── lintersdb/ │ │ │ ├── builder_linter.go │ │ │ ├── builder_plugin_go.go │ │ │ ├── builder_plugin_module.go │ │ │ ├── manager.go │ │ │ ├── manager_test.go │ │ │ ├── validator.go │ │ │ └── validator_test.go │ │ ├── package.go │ │ ├── package_test.go │ │ └── runner.go │ ├── logutils/ │ │ ├── log.go │ │ ├── logutils.go │ │ ├── mock.go │ │ ├── out.go │ │ └── stderr_log.go │ ├── printers/ │ │ ├── checkstyle.go │ │ ├── checkstyle_test.go │ │ ├── codeclimate.go │ │ ├── codeclimate_test.go │ │ ├── html.go │ │ ├── html_test.go │ │ ├── json.go │ │ ├── json_test.go │ │ ├── junitxml.go │ │ ├── junitxml_test.go │ │ ├── printer.go │ │ ├── printer_test.go │ │ ├── sarif.go │ │ ├── sarif_test.go │ │ ├── tab.go │ │ ├── tab_test.go │ │ ├── teamcity.go │ │ ├── teamcity_test.go │ │ ├── testdata/ │ │ │ ├── golden-json.json │ │ │ ├── golden-line-number.txt │ │ │ ├── golden-teamcity.txt │ │ │ ├── in-issues.json │ │ │ └── in-report-data.json │ │ ├── text.go │ │ └── text_test.go │ ├── report/ │ │ ├── data.go │ │ └── log.go │ ├── result/ │ │ ├── issue.go │ │ └── processors/ │ │ ├── base_rule.go │ │ ├── cgo.go │ │ ├── diff.go │ │ ├── exclusion_generated_file_filter.go │ │ ├── exclusion_generated_file_filter_test.go │ │ ├── exclusion_generated_file_matcher.go │ │ ├── exclusion_generated_file_matcher_test.go │ │ ├── exclusion_paths.go │ │ ├── exclusion_paths_test.go │ │ ├── exclusion_presets.go │ │ ├── exclusion_rules.go │ │ ├── exclusion_rules_test.go │ │ ├── filename_unadjuster.go │ │ ├── fixer.go │ │ ├── invalid_issue.go │ │ ├── invalid_issue_test.go │ │ ├── issues.go │ │ ├── max_from_linter.go │ │ ├── max_from_linter_test.go │ │ ├── max_per_file_from_linter.go │ │ ├── max_per_file_from_linter_test.go │ │ ├── max_same_issues.go │ │ ├── max_same_issues_test.go │ │ ├── nolint_filter.go │ │ ├── nolint_filter_test.go │ │ ├── path_absoluter.go │ │ ├── path_prettifier.go │ │ ├── path_prettifier_test.go │ │ ├── path_relativity.go │ │ ├── path_shortener.go │ │ ├── processor.go │ │ ├── processor_test.go │ │ ├── severity.go │ │ ├── severity_test.go │ │ ├── sort_results.go │ │ ├── sort_results_test.go │ │ ├── source_code.go │ │ ├── testdata/ │ │ │ ├── exclusion_generated_file_filter/ │ │ │ │ ├── exclude.go │ │ │ │ ├── exclude_block_comment.go │ │ │ │ ├── exclude_doc.go │ │ │ │ ├── exclude_long_line.go │ │ │ │ ├── go_strict.go │ │ │ │ └── go_strict_invalid.go │ │ │ ├── exclusion_rules/ │ │ │ │ ├── case_sensitive.go │ │ │ │ └── exclusion_rules.go │ │ │ ├── nolint_filter/ │ │ │ │ ├── apply_to_unknown.go │ │ │ │ ├── bad_names.go │ │ │ │ ├── nolint.go │ │ │ │ ├── nolint2.go │ │ │ │ ├── unused.go │ │ │ │ └── whole_file.go │ │ │ └── severity/ │ │ │ ├── exclude_rules.go │ │ │ └── severity_rules.go │ │ ├── uniq_by_line.go │ │ └── uniq_by_line_test.go │ └── timeutils/ │ └── stopwatch.go ├── scripts/ │ ├── bench/ │ │ ├── bench_local.sh │ │ ├── bench_version.sh │ │ └── readme.md │ ├── gen_github_action_config/ │ │ ├── go.mod │ │ ├── go.sum │ │ ├── main.go │ │ ├── main_test.go │ │ ├── testdata/ │ │ │ ├── all-releases-v2.json │ │ │ ├── all-releases.json │ │ │ ├── github-action-config-v1.json │ │ │ ├── github-action-config-v2.json │ │ │ └── github-action-config.json │ │ └── types.go │ ├── print_ast/ │ │ └── main.go │ └── website/ │ ├── copy_jsonschema/ │ │ └── main.go │ ├── dump_info/ │ │ ├── cmd_help.go │ │ ├── default_exclusions.go │ │ ├── formatters.go │ │ ├── linters.go │ │ ├── main.go │ │ ├── thanks.go │ │ └── thanks_test.go │ ├── expand_templates/ │ │ ├── .gitignore │ │ ├── changelog.go │ │ ├── configuration.go │ │ ├── configuration_test.go │ │ ├── main.go │ │ └── plugins.go │ ├── github/ │ │ └── github.go │ └── types/ │ └── types.go ├── test/ │ ├── bench/ │ │ └── bench_test.go │ ├── configuration_file_test.go │ ├── enabled_linters_test.go │ ├── fix_test.go │ ├── linters_test.go │ ├── output_test.go │ ├── run_test.go │ ├── testdata/ │ │ ├── autogenerated/ │ │ │ ├── autogenerated.go │ │ │ ├── do_not_edit.go │ │ │ ├── go_bindata.go │ │ │ ├── mockgen.go │ │ │ └── protoc_gen_foo.go │ │ ├── cgo/ │ │ │ └── main.go │ │ ├── cgo_with_issues/ │ │ │ └── main.go │ │ ├── configs/ │ │ │ ├── custom_linter_goplugin.yml │ │ │ ├── custom_linter_module.yml │ │ │ ├── custom_linter_notype.yml │ │ │ ├── default_exclude.yml │ │ │ ├── multiple-issues-fix.yml │ │ │ ├── output.yml │ │ │ └── path-except.yml │ │ ├── default_exclude.go │ │ ├── fix/ │ │ │ ├── in/ │ │ │ │ └── multiple-issues-fix.go │ │ │ └── out/ │ │ │ └── multiple-issues-fix.go │ │ ├── linedirective/ │ │ │ ├── dupl.yml │ │ │ ├── gomodguard.yml │ │ │ ├── hello.go │ │ │ ├── hello.tmpl │ │ │ └── lll.yml │ │ ├── minimalpkg/ │ │ │ └── minimalpkg.go │ │ ├── nogofiles/ │ │ │ └── test.txt │ │ ├── notcompiles/ │ │ │ ├── typecheck.go │ │ │ └── typecheck_many_issues.go │ │ ├── output.go │ │ ├── path_except.go │ │ ├── path_except_test.go │ │ ├── quicktemplate/ │ │ │ ├── hello.qtpl │ │ │ └── hello.qtpl.go │ │ ├── sort_results/ │ │ │ └── main.go │ │ ├── symlink_loop/ │ │ │ └── realpkg/ │ │ │ └── p.go │ │ ├── unsafe/ │ │ │ └── pkg.go │ │ ├── used_only_in_tests/ │ │ │ ├── a.go │ │ │ └── a_test.go │ │ ├── withconfig/ │ │ │ ├── .golangci.yml │ │ │ └── pkg/ │ │ │ └── pkg.go │ │ ├── withtests/ │ │ │ ├── p.go │ │ │ └── p_test.go │ │ └── withxtest/ │ │ ├── p.go │ │ └── p_test.go │ ├── testdata_etc/ │ │ ├── abspath/ │ │ │ └── with_issue.go │ │ └── unused_exported/ │ │ ├── golangci.yml │ │ ├── lib/ │ │ │ ├── bar_test.go │ │ │ └── foo.go │ │ └── main.go │ └── testshared/ │ ├── analysis.go │ ├── analysis_test.go │ ├── directives.go │ ├── directives_test.go │ ├── install.go │ ├── integration/ │ │ ├── fix.go │ │ └── run.go │ ├── runner.go │ ├── runner_test.go │ ├── runner_unix.go │ ├── runner_windows.go │ └── testdata/ │ └── all.go └── third_party/ ├── dogsled/ │ └── LICENSE ├── gochecknoglobals/ │ └── LICENSE ├── gochecknoinits/ │ └── LICENSE ├── gometalinter/ │ └── LICENSE ├── lll/ │ └── LICENSE ├── nakedret/ │ └── LICENSE └── x_tools/ └── LICENSE ================================================ FILE CONTENTS ================================================ ================================================ FILE: .custom-gcl.reference.yml ================================================ # The golangci-lint version used to build the custom binary. # Required. version: v2.0.0 # The name of the custom binary. # Optional. # Default: custom-gcl name: custom-golangci-lint # The directory path used to store the custom binary. # Optional. # Default: . destination: ./my/path/ # The list of the plugins to integrate inside the custom binary. plugins: # a plugin from a Go proxy - module: 'github.com/example/plugin3' version: v1.2.3 # a plugin from a Go proxy (with a specific import path) - module: 'github.com/example/plugin4' import: 'github.com/example/plugin4/foo' version: v1.0.0 # a plugin from local source (with absolute path) - module: 'github.com/example/plugin2' path: /my/local/path/plugin2 # a plugin from local source (with relative path) - module: 'github.com/example/plugin1' path: ./my/local/path/plugin1 # a plugin from local source (with absolute path and a specific import path) - module: 'github.com/example/plugin2' import: 'github.com/example/plugin4/foo' path: /my/local/path/plugin2 ================================================ FILE: .gitattributes ================================================ go.sum linguist-generated assets/* linguist-generated * text=auto eol=lf *.ps1 text eol=crlf ================================================ FILE: .github/CONTRIBUTING.md ================================================ See [contributing quick start](https://golangci-lint.run/docs/contributing/) on our website. ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.yml ================================================ name: 🐞 Bug Report description: "Create a report to help us improve." labels: [bug] body: - type: checkboxes id: terms attributes: label: Welcome options: - label: Yes, I'm using a binary release within 2 latest [releases](https://github.com/golangci/golangci-lint/releases). Only such installations are supported. required: true - label: Yes, I've searched similar [issues on GitHub](https://github.com/golangci/golangci-lint/issues) and didn't find any. required: true - label: Yes, I've read the `typecheck` section of the [FAQ](https://golangci-lint.run/docs/welcome/faq/#why-do-you-have-typecheck-errors). required: true - label: Yes, I've tried with the standalone [linter](https://golangci-lint.run/docs/linters/) if available (e.g., gocritic, go vet, etc.). required: true - label: I agree to follow this project's [Code of Conduct](https://github.com/golangci/golangci-lint?tab=coc-ov-file) required: true - type: dropdown id: install attributes: label: How did you install golangci-lint? options: - I don't know - Official GitHub Action - Official binary - Brew - MacPorts - Chocolatey - Scoop - Docker - go install - Tools pattern - go tool - AUR - Nix - Deb - RPM - Other Linux package manager - Via editor/IDE - asdf/mise-en-place - Other validations: required: true - type: textarea id: problem attributes: label: Description of the problem placeholder: Your problem description validations: required: true - type: textarea id: version attributes: label: Version of golangci-lint value: |-
```console $ golangci-lint --version # Paste output here ```
validations: required: true - type: textarea id: config attributes: label: Configuration value: |-
```console # paste configuration file or CLI flags here ```
validations: required: true - type: textarea id: go-env attributes: label: Go environment value: |-
```console $ go version && go env # paste output here ```
validations: required: true - type: textarea id: verbose-output attributes: label: Verbose output of running value: |-
```console $ golangci-lint cache clean $ golangci-lint run -v # paste output here ```
validations: required: true - type: textarea id: code-example attributes: label: A minimal reproducible example or link to a public repository description: if your problem is related to a private repository, a minimal reproducible example is required. value: |-
```go // add your code here ```
validations: required: true - type: checkboxes id: validation attributes: label: Validation options: - label: Yes, I've included all information above (version, config, etc.). required: true - type: checkboxes id: supporter attributes: label: Supporter options: - label: I am a [sponsor/backer](https://donate.golangci.org) of this project. ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: false contact_links: - name: 📖 Documentation url: https://golangci-lint.run about: Please take a look to our documentation. - name: ❓ Questions url: https://github.com/golangci/golangci-lint/discussions about: If you have a question, or are looking for advice, please post on our Discussions forum! - name: 💬 Chat on Slack url: https://gophers.slack.com/archives/CS0TBRKPC about: Maybe chatting with the community can help ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.yml ================================================ name: 💡 Feature request description: "Suggest an idea for this project." labels: [enhancement] body: - type: checkboxes id: terms attributes: label: Welcome options: - label: Yes, I've searched similar [issues on GitHub](https://github.com/golangci/golangci-lint/issues) and didn't find any. required: true - label: I agree to follow this project's [Code of Conduct](https://github.com/golangci/golangci-lint?tab=coc-ov-file) required: true - type: dropdown id: install attributes: label: How did you install golangci-lint? options: - I don't know - Official GitHub Action - Official binary - Brew - MacPorts - Chocolatey - Scoop - Docker - go install - Tools pattern - go tool - AUR - Nix - Deb - RPM - Other Linux package manager - Via editor/IDE - asdf/mise-en-place - Other validations: required: true - type: textarea id: problem attributes: label: Your feature request related to a problem? Please describe placeholder: "A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]" validations: required: true - type: textarea id: solution attributes: label: Describe the solution you'd like placeholder: "A clear and concise description of what you want to happen." validations: required: true - type: textarea id: alternatives attributes: label: Describe alternatives you've considered placeholder: "A clear and concise description of any alternative solutions or features you've considered." validations: required: true - type: textarea id: additional attributes: label: Additional context placeholder: "Add any other context or screenshots about the feature request here." validations: required: false - type: checkboxes id: supporter attributes: label: Supporter options: - label: I am a [sponsor/backer](https://donate.golangci.org) of this project. ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ ================================================ FILE: .github/boring-cyborg.yml ================================================ firstPRWelcomeComment: Hey, thank you for opening your first Pull Request ! # Comment to be posted to on first time issues firstIssueWelcomeComment: > Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a [guide for contributors](https://golangci-lint.run/docs/contributing/). ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: gomod directory: "/" schedule: interval: weekly day: "sunday" time: "11:00" # 11am UTC ignore: # Ignore forked linters because of their versioning issues. - dependency-name: "github.com/golangci/dupl" - dependency-name: "github.com/golangci/gofmt" - dependency-name: "github.com/golangci/swaggoswag" - dependency-name: "github.com/golangci/unconvert" - package-ecosystem: github-actions directory: "/" schedule: interval: weekly groups: github-actions: patterns: - "*" # Group all updates into a single larger pull request. - package-ecosystem: docker directory: "/build" schedule: interval: weekly groups: docker: patterns: - "*" # Group all updates into a single larger pull request. - package-ecosystem: gomod directory: "/scripts/gen_github_action_config" schedule: interval: weekly groups: scripts: patterns: - "*" # Group all updates into a single larger pull request. - package-ecosystem: gomod directories: - pkg/golinters/arangolint/testdata/ - pkg/golinters/ginkgolinter/testdata/ - pkg/golinters/loggercheck/testdata/ - pkg/golinters/protogetter/testdata/ - pkg/golinters/spancheck/testdata/ - pkg/golinters/zerologlint/testdata/ groups: linter-testdata: patterns: - "*" # Group all updates into a single larger pull request. schedule: interval: monthly day: "wednesday" time: "11:00" # 11am UTC ================================================ FILE: .github/new-linter-checklist.md ================================================ In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements. - [ ] The CLA must be signed ### Pull Request Description - [ ] It must have a link to the linter repository. - [ ] It must provide a short description of the linter. ### Linter - [ ] It must not be a duplicate of another linter or a rule of a linter (the team will help to verify that). - [ ] It must have a valid license (AGPL is not allowed), and the file must contain the required information by the license, ex: author, year, etc. - [ ] It must use Go version <= 1.22.0 - [ ] The linter repository must have a CI and tests. - [ ] It must use [`go/analysis`](https://golangci-lint.run/docs/contributing/new-linters/). - [ ] It must have a valid tag, ex: `v1.0.0`, `v0.1.0`. - [ ] It must not contain `init()`. - [ ] It must not contain `panic()`. - [ ] It must not contain `log.Fatal()`, `os.Exit()`, or similar. - [ ] It must not modify the AST. - [ ] It must not have false positives/negatives (the team will help to verify that). - [ ] It must have tests inside golangci-lint. ### The Linter Tests Inside Golangci-lint - [ ] They must have at least one std lib import. - [ ] They must have integration tests without configuration (default). - [ ] They must have integration tests with configuration (if the linter has a configuration). ### `.golangci.next.reference.yml` - [ ] The file `.golangci.next.reference.yml` must be updated. - [ ] The file `.golangci.reference.yml` must NOT be edited. - [ ] The linter must be added to the lists of available linters (alphabetical case-insensitive order). - `enable` and `disable` options - [ ] If the linter has a configuration, the exhaustive configuration of the linter must be added (alphabetical case-insensitive order) - The values must be different from the default ones. - The default values must be defined in a comment. - The option must have a short description. ### Others Requirements - [ ] The files (tests and linter) inside golangci-lint must have the same name as the linter. - [ ] The `.golangci.yml` of golangci-lint itself must not be edited and the linter must not be added to this file. - [ ] The linters must be sorted in the alphabetical order (case-insensitive) in the `lintersdb/builder_linter.go` and `.golangci.next.reference.yml`. - [ ] The load mode (`WithLoadMode(...)`): - if the linter uses `goanalysis.LoadModeSyntax` -> no `WithLoadForGoAnalysis()` in `lintersdb/builder_linter.go` - if the linter uses `goanalysis.LoadModeTypesInfo`, it requires `WithLoadForGoAnalysis()` in `lintersdb/builder_linter.go` - [ ] The version in `WithSince(...)` must be the next minor version (`v1.X.0`) of golangci-lint. - [ ] `WithURL()` must contain the URL of the repository. ### Recommendations - [ ] The file `jsonschema/golangci.next.jsonschema.json` should be updated. - [ ] The file `jsonschema/golangci.jsonschema.json` must NOT be edited. - [ ] The linter repository should have a readme and linting. - [ ] The linter should be published as a binary (useful to diagnose bug origins). - [ ] The linter repository should have a `.gitignore` (IDE files, binaries, OS files, etc. should not be committed) - [ ] A tag should never be recreated. - [ ] Use `main` as the default branch name. --- The golangci-lint team will edit this comment to check the boxes before and during the review. The code review will start after the completion of those checkboxes (except for the specific items that the team will help to verify). The reviews should be addressed as commits (no squash). If the author of the PR is a member of the golangci-lint team, he should not edit this message. **This checklist does not imply that we will accept the linter.** ================================================ FILE: .github/peril/.gitignore ================================================ node_modules/ ================================================ FILE: .github/peril/README.md ================================================ Based on https://github.com/gatsbyjs/gatsby/tree/HEAD/peril. ## Update a code ```bash heroku ps:restart web --app golangci-peril heroku logs --app golangci-peril -t ``` ================================================ FILE: .github/peril/package.json ================================================ { "dependencies": { "jest": "^29.0.3" }, "scripts": { "test": "jest" }, "jest": { "rootDir": "../", "roots": [ "/peril" ], "transform": { "^.+\\.tsx?$": "/node_modules/ts-jest/preprocessor.js" }, "moduleFileExtensions": [ "js", "jsx", "ts", "tsx", "json" ] } } ================================================ FILE: .github/peril/rules/invite-collaborator.ts ================================================ import { danger } from "danger"; const comment = (username: string) => ` Hey, @${username} — we just merged your PR to \`golangci-lint\`! 🔥🚀 \`golangci-lint\` is built by awesome people like you. Let us say “thanks”: **we just invited you to join the [GolangCI](https://github.com/golangci) organization on GitHub.** This will add you to our team of maintainers. Accept the invite by visiting [this link](https://github.com/orgs/golangci/invitation). By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests. More information about contributing is [here](https://golangci-lint.run/docs/contributing/). Thanks again! `; const teamId = `3840765`; export const inviteCollaborator = async () => { const gh = danger.github; const api = gh.api; // Details about the repo. const owner = gh.thisPR.owner; const repo = gh.thisPR.repo; const number = gh.thisPR.number; // Details about the collaborator. const username = gh.pr.user.login; // Check whether or not we’ve already invited this contributor. try { const inviteCheck = (await api.teams.getMembership({ team_id: teamId, username, } as any)) as any; const isInvited = inviteCheck.headers.status !== "404"; // If we’ve already invited them, don’t spam them with more messages. if (isInvited) { console.log( `@${username} has already been invited to this org. Doing nothing.` ); return; } } catch (err) { console.info( `Error checking membership of ${username} in team ${teamId}: ${err.stack}` ); // If the user hasn’t been invited, the invite check throws an error. } try { const invite = await api.teams.addOrUpdateMembership({ team_id: teamId, username, } as any); if (invite.data.state === "active") { console.log( `@${username} is already a ${invite.data.role} for this team.` ); } else { console.log(`We’ve invited @${username} to join this team.`); } } catch (err) { console.log("Something went wrong."); console.log(err); return; } // For new contributors, roll out the welcome wagon! await api.issues.createComment({ owner, repo, number, body: comment(username), }); }; export default async () => { await inviteCollaborator(); }; ================================================ FILE: .github/peril/settings.json ================================================ { "$schema": "https://raw.githubusercontent.com/danger/peril/HEAD/peril-settings-json.schema", "settings": { "ignored_repos": [], "env_vars": ["SLACK_WEBHOOK_URL", "GITHUB_ACCESS_TOKEN"] }, "repos": { "golangci/golangci-lint": { "pull_request.closed (pull_request.merged == true)": [ ".github/peril/rules/invite-collaborator.ts" ] } } } ================================================ FILE: .github/peril/tests/invite-collaborator.test.ts ================================================ jest.mock("danger", () => jest.fn()); import * as danger from "danger"; const dm = danger as any; import { inviteCollaborator } from "../rules/invite-collaborator"; beforeEach(() => { dm.danger = { github: { thisPR: { owner: "gatsbyjs", repo: "peril-gatsbyjs", number: 1, }, pr: { user: { login: "someUser", }, }, api: { teams: { getMembership: () => Promise.resolve({ meta: { status: "404" } }), addOrUpdateMembership: jest.fn(() => Promise.resolve({ data: { state: "pending" } }) ), }, issues: { createComment: jest.fn(), }, }, }, }; }); describe("a closed pull request", () => { it("was merged and authored by a first-time contributor", async () => { dm.danger.github.pr.merged = true; await inviteCollaborator(); expect(dm.danger.github.api.issues.createComment).toBeCalled(); expect(dm.danger.github.api.orgs.addTeamMembership).toBeCalled(); }); it("was merged and authored by an existing collaborator", async () => { dm.danger.github.pr.merged = true; dm.danger.github.api.orgs.getTeamMembership = () => Promise.resolve({ headers: { status: "204 No Content" } }); await inviteCollaborator(); expect(dm.danger.github.api.issues.createComment).not.toBeCalled(); }); it("does not comment if invitation failed", async () => { dm.danger.github.pr.merged = true; dm.danger.github.api.orgs.addTeamMembership = () => Promise.reject({ headers: { status: "422 Unprocessable Entity" } }); await inviteCollaborator(); expect(dm.danger.github.api.issues.createComment).not.toBeCalled(); }); }); ================================================ FILE: .github/peril/tsconfig.json ================================================ { "compilerOptions": { "esModuleInterop": false, "target": "es5", "module": "commonjs", "lib": ["es2017"], "strict": true } } ================================================ FILE: .github/stale.yml ================================================ # Number of days of inactivity before an issue becomes stale daysUntilStale: 366 # Number of days of inactivity before a stale issue is closed daysUntilClose: 30 # Issues with these labels will never be considered stale exemptLabels: - pinned - security - blocked - protected - triaged # Label to use when marking an issue as stale staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. # Comment to post when closing a stale issue. Set to `false` to disable closeComment: false ================================================ FILE: .github/workflows/codeql.yml ================================================ # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # # You may wish to alter this file to override the set of languages analyzed, # or to provide custom queries or build logic. name: "CodeQL" on: push: branches: - main pull_request: # The branches below must be a subset of the branches above branches: - main schedule: - cron: '0 17 * * 5' jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: # required for all workflows security-events: write strategy: fail-fast: false matrix: # Override automatic language detection by changing the below list # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] # TODO: Enable for javascript later language: [ 'go'] steps: - name: Checkout repository uses: actions/checkout@v6 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 ================================================ FILE: .github/workflows/deploy-documentation.yml ================================================ name: Deploy Documentation on: push: branches: - main jobs: doc: name: Build and deploy documentation runs-on: ubuntu-latest env: # https://github.com/actions/setup-go#supported-version-syntax # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.26' HUGO_VERSION: 0.148.1 CGO_ENABLED: 0 steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - run: go mod download - name: Setup Hugo run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb - name: Build Documentation run: make docs_build - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: publish_dir: docs/public force_orphan: true github_token: ${{ secrets.GOLANGCI_LINT_TOKEN }} ================================================ FILE: .github/workflows/new-linter-checklist.yml ================================================ name: Add new linter checklist on: workflow_dispatch: inputs: pr: description: PR number required: true type: number permissions: pull-requests: write jobs: add-comment: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Add checklist run: | # Avoid adding multiple comments for the same PR. comment_exist=$(gh pr view "$NUMBER" \ --json comments \ --jq '.comments[].author | select(.login=="github-actions") | .login' \ | wc -l) [ "$comment_exist" -gt 0 ] && edit_last="--edit-last" gh pr comment "$NUMBER" --body "$(cat .github/new-linter-checklist.md)" $edit_last env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ inputs.pr }} ================================================ FILE: .github/workflows/post-release.yml ================================================ name: "Post release" on: release: types: - published env: # https://github.com/actions/setup-go#supported-version-syntax # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.26' jobs: update-gha-assets: name: "Update GitHub Action assets" runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - name: Update GitHub Action config run: make assets/github-action-config.json - name: Create Pull Request uses: peter-evans/create-pull-request@v8 with: base: main token: ${{ secrets.GOLANGCI_LINT_TOKEN }} branch-suffix: timestamp title: "docs: update GitHub Action assets" delete-branch: true update-assets: name: "Update documentation assets" runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - name: Update reference files run: cp .golangci.next.reference.yml .golangci.reference.yml - name: Update JSON schema files run: cp jsonschema/golangci.next.jsonschema.json jsonschema/golangci.jsonschema.json - name: Update information run: make website_dump_info - name: Create Pull Request uses: peter-evans/create-pull-request@v8 with: base: main token: ${{ secrets.GOLANGCI_LINT_TOKEN }} branch-suffix: timestamp title: "docs: update documentation assets" delete-branch: true body: | - [ ] update changelog - [ ] add previous version JSON Schema check-install-script: name: Installation script (remote) strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - run: curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b "./install-golangci-lint" ================================================ FILE: .github/workflows/pr-checks.yml ================================================ name: Checks on: push: branches: - main pull_request: env: # https://github.com/actions/setup-go#supported-version-syntax # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.26' jobs: # Check if there is any dirty change for go mod tidy go-mod: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - name: Check go mod run: | go mod tidy git diff --exit-code go.mod git diff --exit-code go.sum # This check is disabled because of GitHub API instability: 504 Gateway Timeout. # Checks: GitHub action assets # check-generated: # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v6 # with: # fetch-depth: 0 # - uses: actions/setup-go@v6 # with: # go-version: ${{ env.GO_VERSION }} # - name: Check generated files are up-to-date # run: make fast_check_generated # env: # # needed for github-action-config.json generation # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} check-local-install-script: name: Installation script (local) strategy: matrix: os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 - name: Check installation script run: cat ./install.sh | sh -s -- -d -b "./install-golangci-lint" # Note: the command `run` is tested by the other workflows (`make test`). check-commands: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - name: Build golangci-lint run: make build - run: ./golangci-lint - run: ./golangci-lint fmt - run: ./golangci-lint fmt --diff - run: cat cmd/golangci-lint/main.go | ./golangci-lint fmt --stdin - run: ./golangci-lint cache - run: ./golangci-lint cache status - run: ./golangci-lint cache clean - run: ./golangci-lint completion - run: ./golangci-lint completion bash - run: ./golangci-lint completion bash --no-descriptions - run: ./golangci-lint completion zsh - run: ./golangci-lint completion zsh --no-descriptions - run: ./golangci-lint completion fish - run: ./golangci-lint completion fish --no-descriptions - run: ./golangci-lint completion powershell - run: ./golangci-lint completion powershell --no-descriptions - run: ./golangci-lint config - run: ./golangci-lint config path - run: ./golangci-lint config path --json - run: ./golangci-lint config verify --schema jsonschema/golangci.next.jsonschema.json - run: ./golangci-lint help - run: ./golangci-lint help linters - run: ./golangci-lint help linters --json - run: ./golangci-lint help formatters - run: ./golangci-lint help formatters --json - run: ./golangci-lint linters - run: ./golangci-lint linters --json - run: ./golangci-lint formatters - run: ./golangci-lint formatters --json - run: ./golangci-lint version - run: ./golangci-lint version --short - run: ./golangci-lint version --debug - run: ./golangci-lint version --json - run: ./golangci-lint version --json --debug ================================================ FILE: .github/workflows/pr-documentation.yml ================================================ name: Check Documentation on: pull_request: jobs: doc: name: Build documentation runs-on: ubuntu-latest env: # https://github.com/actions/setup-go#supported-version-syntax # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.26' HUGO_VERSION: 0.148.1 CGO_ENABLED: 0 steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - run: go mod download - name: Setup Hugo run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb - name: Build Documentation run: make docs_build ================================================ FILE: .github/workflows/pr-tests.yml ================================================ name: Tests on: push: branches: - main pull_request: env: # https://github.com/actions/setup-go#supported-version-syntax # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.26' jobs: # Check if there is any dirty change for go mod tidy go-mod: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - name: Check go mod run: | go mod tidy git diff --exit-code go.mod git diff --exit-code go.sum # We already run the current golangci-lint in tests, but here we test # our GitHub action with the latest stable golangci-lint. golangci-lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: # https://github.com/actions/setup-go#supported-version-syntax # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 # TODO(ldez) must be changed after the first release of golangci-lint with go1.25 # go-version: ${{ env.GO_VERSION }} go-version: '1.25' - name: lint uses: golangci/golangci-lint-action@v9.2.0 with: version: latest tests-on-windows: needs: golangci-lint # run after golangci-lint action to not produce duplicated errors runs-on: windows-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI - name: Run tests run: make.exe test tests-on-macos: needs: golangci-lint # run after golangci-lint action to not produce duplicated errors runs-on: macos-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI - name: Run tests run: make test tests-on-unix: needs: golangci-lint # run after golangci-lint action to not produce duplicated errors strategy: matrix: os: - ubuntu-latest - ubuntu-24.04-arm golang: - '1.25' - '1.26' runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version: ${{ matrix.golang }} - name: Run tests run: make test ================================================ FILE: .github/workflows/release.yml ================================================ name: "Release a tag" on: push: tags: - v* permissions: # Allow the workflow to write attestations. id-token: write attestations: write jobs: release: runs-on: ubuntu-latest env: # https://github.com/actions/setup-go#supported-version-syntax # ex: # - 1.18beta1 -> 1.18.0-beta.1 # - 1.18rc1 -> 1.18.0-rc.1 GO_VERSION: '1.26' CHOCOLATEY_VERSION: 2.2.0 steps: # temporary workaround for an error in free disk space action # https://github.com/jlumbroso/free-disk-space/issues/14 - name: Update Package List and Remove Dotnet run: | sudo apt-get update sudo apt-get remove -y '^dotnet-.*' # https://github.com/marketplace/actions/free-disk-space-ubuntu - name: Free Disk Space uses: jlumbroso/free-disk-space@main with: # this might remove tools that are actually needed tool-cache: false # all of these default to true android: true dotnet: true haskell: true large-packages: true docker-images: true swap-storage: false - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} # - name: Install chocolatey # run: | # mono --version # mkdir -p /opt/chocolatey # wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey" # echo '#!/bin/bash' >> /usr/local/bin/choco # echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco # chmod +x /usr/local/bin/choco # choco --version - name: Install snapcraft run: sudo snap install snapcraft --classic - name: Set up QEMU uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Login do docker.io run: docker login -u golangci -p ${{ secrets.GOLANGCI_LINT_DOCKER_TOKEN }} - name: Create release id: goreleaser uses: goreleaser/goreleaser-action@v7 with: version: latest args: release --clean --timeout=90m env: AUR_KEY: ${{ secrets.AUR_KEY }} CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }} - uses: actions/attest@v4 with: subject-checksums: ./dist/golangci-lint-${{ fromJSON(steps.goreleaser.outputs.metadata).version }}-checksums.txt github-token: ${{ secrets.GOLANGCI_LINT_TOKEN }} - uses: actions/attest@v4 with: subject-checksums: ./dist/digests.txt github-token: ${{ secrets.GOLANGCI_LINT_TOKEN }} ================================================ FILE: .gitignore ================================================ *.test .DS_Store /*.pdf /*.pprof /*.txt /test.lock /.idea/ /.vscode/ /dist/ /golangci-lint /golangci-lint.exe /test/path /tools/Dracula.itermcolors /tools/dist/ /tools/godownloader /tools/goreleaser /tools/node_modules /tools/svg-term /vendor/ coverage.out coverage.xml /custom-golangci-lint /custom-gcl .custom-gcl.yml .custom-gcl.yaml **/testdata/fix.tmp/ ================================================ FILE: .golangci.next.reference.yml ================================================ # This file contains all available configuration options # with their default values (in comments). # # This file is not a configuration example, # it contains the exhaustive configuration with explanations of the options. # Defines the configuration version. # The only possible value is "2". version: "2" linters: # Default set of linters. # The value can be: # - `standard`: https://golangci-lint.run/docs/linters/#enabled-by-default # - `all`: enables all linters by default. # - `none`: disables all linters by default. # - `fast`: enables only linters considered as "fast" (`golangci-lint help linters --json | jq '[ .[] | select(.fast==true) ] | map(.name)'`). # Default: standard default: all # Enable specific linter. enable: - arangolint - asasalint - asciicheck - bidichk - bodyclose - canonicalheader - containedctx - contextcheck - copyloopvar - cyclop - decorder - depguard - dogsled - dupl - dupword - durationcheck - embeddedstructfieldcheck - err113 - errcheck - errchkjson - errname - errorlint - exhaustive - exhaustruct - exptostd - fatcontext - forbidigo - forcetypeassert - funcorder - funlen - ginkgolinter - gocheckcompilerdirectives - gochecknoglobals - gochecknoinits - gochecksumtype - gocognit - goconst - gocritic - gocyclo - godoclint - godot - godox - goheader - gomoddirectives - gomodguard - goprintffuncname - gosec - gosmopolitan - govet - grouper - iface - importas - inamedparam - ineffassign - interfacebloat - intrange - iotamixing - ireturn - lll - loggercheck - maintidx - makezero - mirror - misspell - mnd - modernize - musttag - nakedret - nestif - nilerr - nilnesserr - nilnil - nlreturn - noctx - noinlineerr - nolintlint - nonamedreturns - nosprintfhostport - paralleltest - perfsprint - prealloc - predeclared - promlinter - protogetter - reassign - recvcheck - revive - rowserrcheck - sloglint - spancheck - sqlclosecheck - staticcheck - tagalign - tagliatelle - testableexamples - testifylint - testpackage - thelper - tparallel - unconvert - unparam - unqueryvet - unused - usestdlibvars - usetesting - varnamelen - wastedassign - whitespace - wrapcheck - wsl - wsl_v5 - zerologlint # Disable specific linters. disable: - arangolint - asasalint - asciicheck - bidichk - bodyclose - canonicalheader - containedctx - contextcheck - copyloopvar - cyclop - decorder - depguard - dogsled - dupl - dupword - durationcheck - embeddedstructfieldcheck - err113 - errcheck - errchkjson - errname - errorlint - exhaustive - exhaustruct - exptostd - fatcontext - forbidigo - forcetypeassert - funcorder - funlen - ginkgolinter - gocheckcompilerdirectives - gochecknoglobals - gochecknoinits - gochecksumtype - gocognit - goconst - gocritic - gocyclo - godoclint - godot - godox - goheader - gomoddirectives - gomodguard - goprintffuncname - gosec - gosmopolitan - govet - grouper - iface - importas - inamedparam - ineffassign - interfacebloat - intrange - iotamixing - ireturn - lll - loggercheck - maintidx - makezero - mirror - misspell - mnd - modernize - musttag - nakedret - nestif - nilerr - nilnesserr - nilnil - nlreturn - noctx - noinlineerr - nolintlint - nonamedreturns - nosprintfhostport - paralleltest - perfsprint - prealloc - predeclared - promlinter - protogetter - reassign - recvcheck - revive - rowserrcheck - sloglint - spancheck - sqlclosecheck - staticcheck - tagalign - tagliatelle - testableexamples - testifylint - testpackage - thelper - tparallel - unconvert - unparam - unqueryvet - unused - usestdlibvars - usetesting - varnamelen - wastedassign - whitespace - wrapcheck - wsl - wsl_v5 - zerologlint # All available settings of specific linters. settings: asasalint: # To specify a set of function names to exclude. # The values are merged with the builtin exclusions. # The builtin exclusions can be disabled by setting `use-builtin-exclusions` to `false`. # Default: ["^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$"] exclude: - Append - \.Wrapf # To enable/disable the asasalint builtin exclusions of function names. # See the default value of `exclude` to get the builtin exclusions. # Default: true use-builtin-exclusions: false bidichk: # The following configurations check for all mentioned invisible Unicode runes. # All runes are enabled by default. left-to-right-embedding: false right-to-left-embedding: false pop-directional-formatting: false left-to-right-override: false right-to-left-override: false left-to-right-isolate: false right-to-left-isolate: false first-strong-isolate: false pop-directional-isolate: false copyloopvar: # Check all assigning the loop variable to another variable. # Default: false check-alias: true cyclop: # The maximal code complexity to report. # Default: 10 max-complexity: 10 # The maximal average package complexity. # If it's higher than 0.0 (float) the check is enabled. # Default: 0.0 package-average: 0.5 decorder: # Required order of `type`, `const`, `var` and `func` declarations inside a file. # Default: types before constants before variables before functions. dec-order: - type - const - var - func # If true, underscore vars (vars with "_" as the name) will be ignored at all checks. # Default: false (underscore vars are not ignored) ignore-underscore-vars: false # If true, order of declarations is not checked at all. # Default: true (disabled) disable-dec-order-check: false # If true, `init` func can be anywhere in file (does not have to be declared before all other functions). # Default: true (disabled) disable-init-func-first-check: false # If true, multiple global `type`, `const` and `var` declarations are allowed. # Default: true (disabled) disable-dec-num-check: false # If true, type declarations will be ignored for dec num check. # Default: false (type statements are not ignored) disable-type-dec-num-check: false # If true, const declarations will be ignored for dec num check. # Default: false (const statements are not ignored) disable-const-dec-num-check: false # If true, var declarations will be ignored for dec num check. # Default: false (var statements are not ignored) disable-var-dec-num-check: false depguard: # Rules to apply. # # Variables: # - File Variables # Use an exclamation mark `!` to negate a variable. # Example: `!$test` matches any file that is not a go test file. # # `$all` - matches all go files # `$test` - matches all go test files # # - Package Variables # # `$gostd` - matches all of go's standard library (Pulled from `GOROOT`) # # Default (applies if no custom rules are defined): Only allow $gostd in all files. rules: # Name of a rule. main: # Defines package matching behavior. Available modes: # - `original`: allowed if it doesn't match the deny list and either matches the allow list or the allow list is empty. # - `strict`: allowed only if it matches the allow list and either doesn't match the deny list or the allow rule is more specific (longer) than the deny rule. # - `lax`: allowed if it doesn't match the deny list or the allow rule is more specific (longer) than the deny rule. # Default: "original" list-mode: lax # List of file globs that will match this list of settings to compare against. # By default, if a path is relative, it is relative to the directory where the golangci-lint command is executed. # The placeholder '${base-path}' is substituted with a path relative to the mode defined with `run.relative-path-mode`. # The placeholder '${config-path}' is substituted with a path relative to the configuration file. # Default: $all files: - "!**/*_a _file.go" # List of allowed packages. # Entries can be a variable (starting with $), a string prefix, or an exact match (if ending with $). # Default: [] allow: - $gostd - github.com/OpenPeeDeeP # List of packages that are not allowed. # Entries can be a variable (starting with $), a string prefix, or an exact match (if ending with $). # Default: [] deny: - pkg: "math/rand$" desc: use math/rand/v2 - pkg: "github.com/sirupsen/logrus" desc: not allowed - pkg: "github.com/pkg/errors" desc: Should be replaced by standard lib errors package dogsled: # Checks assignments with too many blank identifiers. # Default: 2 max-blank-identifiers: 3 dupl: # Tokens count to trigger issue. # Default: 150 threshold: 100 dupword: # Keywords for detecting duplicate words. # If this list is not empty, only the words defined in this list will be detected. # Default: [] keywords: - "the" - "and" - "a" # Keywords used to ignore detection. # Default: [] ignore: - "0C0C" # Checks only comments, skip strings. # Default: false comments-only: true embeddedstructfieldcheck: # Checks that there is an empty space between the embedded fields and regular fields. # Default: true empty-line: false # Checks that sync.Mutex and sync.RWMutex are not used as embedded fields. # Default: false forbid-mutex: true errcheck: # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. # Such cases aren't reported by default. # Default: false check-type-assertions: true # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`. # Such cases aren't reported by default. # Default: false check-blank: true # To disable the errcheck built-in exclude list. # See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details. # Default: false disable-default-exclusions: true # List of functions to exclude from checking, where each entry is a single function to exclude. # See https://github.com/kisielk/errcheck#excluding-functions for details. exclude-functions: - io/ioutil.ReadFile - io.Copy(*bytes.Buffer) - io.Copy(os.Stdout) # Display function signature instead of selector. # Default: false verbose: true errchkjson: # With check-error-free-encoding set to true, errchkjson does warn about errors # from json encoding functions that are safe to be ignored, # because they are not possible to happen. # # if check-error-free-encoding is set to true and errcheck linter is enabled, # it is recommended to add the following exceptions to prevent from false positives: # # linters: # settings: # errcheck: # exclude-functions: # - encoding/json.Marshal # - encoding/json.MarshalIndent # # Default: false check-error-free-encoding: true # Issue on struct encoding that doesn't have exported fields. # Default: false report-no-exported: false errorlint: # Check whether fmt.Errorf uses the %w verb for formatting errors. # See the https://github.com/polyfloyd/go-errorlint for caveats. # Default: true errorf: false # Permit more than 1 %w verb, valid per Go 1.20 (requires `errorf: true`). # Default: true errorf-multi: false # Check for plain type assertions and type switches. # Default: true asserts: false # Check for plain error comparisons. # Default: true comparison: false # Allowed errors. # Default: [] allowed-errors: - err: "io.EOF" fun: "example.com/pkg.Read" # Allowed error "wildcards". # Default: [] allowed-errors-wildcard: - err: "example.com/pkg.ErrMagic" fun: "example.com/pkg.Magic" exhaustive: # Program elements to check for exhaustiveness. # Default: [ switch ] check: - switch - map # Presence of "default" case in switch statements satisfies exhaustiveness, # even if all enum members are not listed. # Default: false default-signifies-exhaustive: true # Enum members matching the supplied regex do not have to be listed in # switch statements to satisfy exhaustiveness. # Default: "" ignore-enum-members: "Example.+" # Enum types matching the supplied regex do not have to be listed in # switch statements to satisfy exhaustiveness. # Default: "" ignore-enum-types: "Example.+" # Consider enums only in package scopes, not in inner scopes. # Default: false package-scope-only: true # Only run exhaustive check on switches with "//exhaustive:enforce" comment. # Default: false explicit-exhaustive-switch: true # Only run exhaustive check on map literals with "//exhaustive:enforce" comment. # Default: false explicit-exhaustive-map: true # Switch statement requires default case even if exhaustive. # Default: false default-case-required: true exhaustruct: # List of regular expressions to match type names that should be processed. # Anonymous structs can be matched by '' alias. # # Each regular expression must match the full type name, including package path. # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`, # but not `http\.Cookie`. # Default: [] include: - '.+\.Test' - 'example\.com/package\.ExampleStruct[\d]{1,2}' # List of regular expressions to match type names that should be excluded from processing. # Anonymous structs can be matched by '' alias. # Has precedence over `include`. # Each regular expression must match the full type name, including package path. # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`, # but not `http\.Cookie`. # Default: [] exclude: - '.+/cobra\.Command$' # Allows empty structures, effectively excluding them from the check. # Default: false allow-empty: true # List of regular expressions to match type names that should be allowed to be empty. # Anonymous structs can be matched by '' alias. # Each regular expression must match the full type name, including package path. # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`, # but not `http\.Cookie`. # Default: [] allow-empty-rx: - '.*/http\.Cookie' # Allows empty structures in return statements. # Default: false allow-empty-returns: true # Allows empty structures in variable declarations. # Default: false allow-empty-declarations: true fatcontext: # Check for potential fat contexts in struct pointers. # May generate false positives. # Default: false check-struct-pointers: true forbidigo: # Forbid the following identifiers (list of regexp). # Default: ["^(fmt\\.Print(|f|ln)|print|println)$"] forbid: # Built-in bootstrapping functions. - pattern: ^print(ln)?$ # Optional message that gets included in error reports. - pattern: ^fmt\.Print.*$ msg: Do not commit print statements. # Alternatively, put messages at the end of the regex, surrounded by `(# )?`. # Escape any special characters. Those messages get included in error reports. - pattern: 'fmt\.Print.*(# Do not commit print statements\.)?' # Forbid spew Dump, whether it is called as function or method. # Depends on analyze-types below. - pattern: ^spew\.(ConfigState\.)?Dump$ # The package name might be ambiguous. # The full import path can be used as additional criteria. # Depends on analyze-types below. - pattern: ^v1.Dump$ pkg: ^example.com/pkg/api/v1$ # Exclude godoc examples from forbidigo checks. # Default: true exclude-godoc-examples: false # Instead of matching the literal source code, # use type information to replace expressions with strings that contain the package name # and (for methods and fields) the type name. # This makes it possible to handle import renaming and forbid struct fields and methods. # Default: false analyze-types: true funcorder: # Checks that constructors are placed after the structure declaration. # Default: true constructor: false # Checks if the exported methods of a structure are placed before the non-exported ones. # Default: true struct-method: false # Checks if the constructors and/or structure methods are sorted alphabetically. # Default: false alphabetical: true funlen: # Checks the number of lines in a function. # If lower than 0, disable the check. # Default: 60 lines: -1 # Checks the number of statements in a function. # If lower than 0, disable the check. # Default: 40 statements: -1 # Ignore comments when counting lines. # Default: true ignore-comments: false ginkgolinter: # Suppress the wrong length assertion warning. # Default: false suppress-len-assertion: true # Suppress the wrong nil assertion warning. # Default: false suppress-nil-assertion: true # Suppress the wrong error assertion warning. # Default: false suppress-err-assertion: true # Suppress the wrong comparison assertion warning. # Default: false suppress-compare-assertion: true # Suppress the function all in async assertion warning. # Default: false suppress-async-assertion: true # Suppress warning for comparing values from different types, like `int32` and `uint32`. # Default: false suppress-type-compare-assertion: true # Trigger warning for ginkgo focus containers like `FDescribe`, `FContext`, `FWhen` or `FIt`. # Default: false forbid-focus-container: true # Don't trigger warnings for HaveLen(0) # Default: false allow-havelen-zero: true # Force using `Expect` with `To`, `ToNot` or `NotTo`. # Reject using `Expect` with `Should` or `ShouldNot`. # Default: false force-expect-to: true # Best effort validation of async intervals (timeout and polling). # Ignored the `suppress-async-assertion` is true. # Default: false validate-async-intervals: true # Trigger a warning for variable assignments in ginkgo containers like `Describe`, `Context` and `When`, instead of in `BeforeEach()`. # Default: false forbid-spec-pollution: true # Force using the Succeed matcher for error functions, and the HaveOccurred matcher for non-function error values. # Default: false force-succeed: true # Force adding assertion descriptions to gomega matchers. # Default: false force-assertion-description: true # Force using `ToNot`, `ShouldNot` instead of `To(Not())`. # Default: false force-tonot: true gochecksumtype: # Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed. # Default: true default-signifies-exhaustive: false # Include shared interfaces in the exhaustiveness check. # Default: false include-shared-interfaces: true gocognit: # Minimal code complexity to report. # Default: 30 (but we recommend 10-20) min-complexity: 10 goconst: # Minimal length of string constant. # Default: 3 min-len: 2 # Minimum occurrences of constant string count to trigger issue. # Default: 3 min-occurrences: 2 # Look for existing constants matching the values. # Default: true match-constant: false # Search also for duplicated numbers. # Default: false numbers: true # Minimum value, only works with `goconst.numbers`. # Default: 3 min: 2 # Maximum value, only works with `goconst.numbers`. # Default: 3 max: 2 # Ignore when constant is not used as function argument. # Default: true ignore-calls: false # Exclude strings matching the given regular expression. # Default: "" ignore-string-values: - 'foo.+' # Detects constants with identical values. # Default: false find-duplicates: true # Evaluates of constant expressions like Prefix + "suffix". # Default: false eval-const-expressions: true gocritic: # Disable all checks. # Default: false disable-all: true # Which checks should be enabled in addition to default checks; can't be combined with 'disabled-checks'. # By default, list of stable checks is used (https://go-critic.com/overview#checks-overview): # appendAssign, argOrder, assignOp, badCall, badCond, captLocal, caseOrder, codegenComment, commentFormatting, # defaultCaseOrder, deprecatedComment, dupArg, dupBranchBody, dupCase, dupSubExpr, elseif, exitAfterDefer, # flagDeref, flagName, ifElseChain, mapKey, newDeref, offBy1, regexpMust, singleCaseSwitch, sloppyLen, # sloppyTypeAssert, switchTrue, typeSwitchVar, underef, unlambda, unslice, valSwap, wrapperFunc # To see which checks are enabled run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic`. enabled-checks: # Detects suspicious append result assignments. # https://go-critic.com/overview.html#appendassign - appendAssign # Detects `append` chains to the same slice that can be done in a single `append` call. # https://go-critic.com/overview.html#appendcombine - appendCombine # Detects suspicious arguments order. # https://go-critic.com/overview.html#argorder - argOrder # Detects assignments that can be simplified by using assignment operators. # https://go-critic.com/overview.html#assignop - assignOp # Detects suspicious function calls. # https://go-critic.com/overview.html#badcall - badCall # Detects suspicious condition expressions. # https://go-critic.com/overview.html#badcond - badCond # Detects suspicious mutex lock/unlock operations. # https://go-critic.com/overview.html#badlock - badLock # Detects suspicious regexp patterns. # https://go-critic.com/overview.html#badregexp - badRegexp # Detects bad usage of sort package. # https://go-critic.com/overview.html#badsorting - badSorting # Detects bad usage of sync.OnceFunc. # https://go-critic.com/overview.html#badsynconcefunc - badSyncOnceFunc # Detects bool expressions that can be simplified. # https://go-critic.com/overview.html#boolexprsimplify - boolExprSimplify # Detects when predeclared identifiers are shadowed in assignments. # https://go-critic.com/overview.html#builtinshadow - builtinShadow # Detects top-level declarations that shadow the predeclared identifiers. # https://go-critic.com/overview.html#builtinshadowdecl - builtinShadowDecl # Detects capitalized names for local variables. # https://go-critic.com/overview.html#captlocal - captLocal # Detects erroneous case order inside switch statements. # https://go-critic.com/overview.html#caseorder - caseOrder # Detects malformed 'code generated' file comments. # https://go-critic.com/overview.html#codegencomment - codegenComment # Detects comments with non-idiomatic formatting. # https://go-critic.com/overview.html#commentformatting - commentFormatting # Detects commented-out code inside function bodies. # https://go-critic.com/overview.html#commentedoutcode - commentedOutCode # Detects commented-out imports. # https://go-critic.com/overview.html#commentedoutimport - commentedOutImport # Detects when default case in switch isn't on 1st or last position. # https://go-critic.com/overview.html#defaultcaseorder - defaultCaseOrder # Detects loops inside functions that use defer. # https://go-critic.com/overview.html#deferinloop - deferInLoop # Detects deferred function literals that can be simplified. # https://go-critic.com/overview.html#deferunlambda - deferUnlambda # Detects malformed 'deprecated' doc-comments. # https://go-critic.com/overview.html#deprecatedcomment - deprecatedComment # Detects comments that silence go lint complaints about doc-comment. # https://go-critic.com/overview.html#docstub - docStub # Detects suspicious duplicated arguments. # https://go-critic.com/overview.html#duparg - dupArg # Detects duplicated branch bodies inside conditional statements. # https://go-critic.com/overview.html#dupbranchbody - dupBranchBody # Detects duplicated case clauses inside switch or select statements. # https://go-critic.com/overview.html#dupcase - dupCase # Detects multiple imports of the same package under different aliases. # https://go-critic.com/overview.html#dupimport - dupImport # Detects duplicated option function arguments in variadic function calls. # https://go-critic.com/overview.html#dupoption - dupOption # Detects suspicious duplicated sub-expressions. # https://go-critic.com/overview.html#dupsubexpr - dupSubExpr # Detects suspicious formatting strings usage. # https://go-critic.com/overview.html#dynamicfmtstring - dynamicFmtString # Detects else with nested if statement that can be replaced with else-if. # https://go-critic.com/overview.html#elseif - elseif # Detects suspicious empty declarations blocks. # https://go-critic.com/overview.html#emptydecl - emptyDecl # Detects fallthrough that can be avoided by using multi case values. # https://go-critic.com/overview.html#emptyfallthrough - emptyFallthrough # Detects empty string checks that can be written more idiomatically. # https://go-critic.com/overview.html#emptystringtest - emptyStringTest # Detects unoptimal strings/bytes case-insensitive comparison. # https://go-critic.com/overview.html#equalfold - equalFold # Detects unwanted dependencies on the evaluation order. # https://go-critic.com/overview.html#evalorder - evalOrder # Detects calls to exit/fatal inside functions that use defer. # https://go-critic.com/overview.html#exitafterdefer - exitAfterDefer # Detects exposed methods from sync.Mutex and sync.RWMutex. # https://go-critic.com/overview.html#exposedsyncmutex - exposedSyncMutex # Detects suspicious reassignment of error from another package. # https://go-critic.com/overview.html#externalerrorreassign - externalErrorReassign # Detects problems in filepath.Join() function calls. # https://go-critic.com/overview.html#filepathjoin - filepathJoin # Detects immediate dereferencing of `flag` package pointers. # https://go-critic.com/overview.html#flagderef - flagDeref # Detects suspicious flag names. # https://go-critic.com/overview.html#flagname - flagName # Detects hex literals that have mixed case letter digits. # https://go-critic.com/overview.html#hexliteral - hexLiteral # Detects nil usages in http.NewRequest calls, suggesting http.NoBody as an alternative. # https://go-critic.com/overview.html#httpnobody - httpNoBody # Detects params that incur excessive amount of copying. # https://go-critic.com/overview.html#hugeparam - hugeParam # Detects repeated if-else statements and suggests to replace them with switch statement. # https://go-critic.com/overview.html#ifelsechain - ifElseChain # Detects when imported package names shadowed in the assignments. # https://go-critic.com/overview.html#importshadow - importShadow # Detects strings.Index calls that may cause unwanted allocs. # https://go-critic.com/overview.html#indexalloc - indexAlloc # Detects non-assignment statements inside if/switch init clause. # https://go-critic.com/overview.html#initclause - initClause # Detects suspicious map literal keys. # https://go-critic.com/overview.html#mapkey - mapKey # Detects method expression call that can be replaced with a method call. # https://go-critic.com/overview.html#methodexprcall - methodExprCall # Finds where nesting level could be reduced. # https://go-critic.com/overview.html#nestingreduce - nestingReduce # Detects immediate dereferencing of `new` expressions. # https://go-critic.com/overview.html#newderef - newDeref # Detects return statements those results evaluate to nil. # https://go-critic.com/overview.html#nilvalreturn - nilValReturn # Detects old-style octal literals. # https://go-critic.com/overview.html#octalliteral - octalLiteral # Detects various off-by-one kind of errors. # https://go-critic.com/overview.html#offby1 - offBy1 # Detects if function parameters could be combined by type and suggest the way to do it. # https://go-critic.com/overview.html#paramtypecombine - paramTypeCombine # Detects expressions like []rune(s)[0] that may cause unwanted rune slice allocation. # https://go-critic.com/overview.html#preferdecoderune - preferDecodeRune # Detects concatenation with os.PathSeparator which can be replaced with filepath.Join. # https://go-critic.com/overview.html#preferfilepathjoin - preferFilepathJoin # Detects fmt.Sprint(f/ln) calls which can be replaced with fmt.Fprint(f/ln). # https://go-critic.com/overview.html#preferfprint - preferFprint # Detects w.Write or io.WriteString calls which can be replaced with w.WriteString. # https://go-critic.com/overview.html#preferstringwriter - preferStringWriter # Detects WriteRune calls with rune literal argument that is single byte and reports to use WriteByte instead. # https://go-critic.com/overview.html#preferwritebyte - preferWriteByte # Detects input and output parameters that have a type of pointer to referential type. # https://go-critic.com/overview.html#ptrtorefparam - ptrToRefParam # Detects append all its data while range it. # https://go-critic.com/overview.html#rangeappendall - rangeAppendAll # Detects expensive copies of `for` loop range expressions. # https://go-critic.com/overview.html#rangeexprcopy - rangeExprCopy # Detects loops that copy big objects during each iteration. # https://go-critic.com/overview.html#rangevalcopy - rangeValCopy # Detects redundant fmt.Sprint calls. # https://go-critic.com/overview.html#redundantsprint - redundantSprint # Detects `regexp.Compile*` that can be replaced with `regexp.MustCompile*`. # https://go-critic.com/overview.html#regexpmust - regexpMust # Detects suspicious regexp patterns. # https://go-critic.com/overview.html#regexppattern - regexpPattern # Detects regexp patterns that can be simplified. # https://go-critic.com/overview.html#regexpsimplify - regexpSimplify # Detects suspicious http.Error call without following return. # https://go-critic.com/overview.html#returnafterhttperror - returnAfterHttpError # Runs user-defined rules using ruleguard linter. # https://go-critic.com/overview.html#ruleguard - ruleguard # Detects switch statements that could be better written as if statement. # https://go-critic.com/overview.html#singlecaseswitch - singleCaseSwitch # Detects slice clear loops, suggests an idiom that is recognized by the Go compiler. # https://go-critic.com/overview.html#sliceclear - sliceClear # Detects usage of `len` when result is obvious or doesn't make sense. # https://go-critic.com/overview.html#sloppylen - sloppyLen # Detects suspicious/confusing re-assignments. # https://go-critic.com/overview.html#sloppyreassign - sloppyReassign # Detects redundant type assertions. # https://go-critic.com/overview.html#sloppytypeassert - sloppyTypeAssert # Detects suspicious sort.Slice calls. # https://go-critic.com/overview.html#sortslice - sortSlice # Detects "%s" formatting directives that can be replaced with %q. # https://go-critic.com/overview.html#sprintfquotedstring - sprintfQuotedString # Detects issue in Query() and Exec() calls. # https://go-critic.com/overview.html#sqlquery - sqlQuery # Detects string concat operations that can be simplified. # https://go-critic.com/overview.html#stringconcatsimplify - stringConcatSimplify # Detects redundant conversions between string and []byte. # https://go-critic.com/overview.html#stringxbytes - stringXbytes # Detects strings.Compare usage. # https://go-critic.com/overview.html#stringscompare - stringsCompare # Detects switch-over-bool statements that use explicit `true` tag value. # https://go-critic.com/overview.html#switchtrue - switchTrue # Detects sync.Map load+delete operations that can be replaced with LoadAndDelete. # https://go-critic.com/overview.html#syncmaploadanddelete - syncMapLoadAndDelete # Detects manual conversion to milli- or microseconds. # https://go-critic.com/overview.html#timeexprsimplify - timeExprSimplify # Detects TODO comments without detail/assignee. # https://go-critic.com/overview.html#todocommentwithoutdetail - todoCommentWithoutDetail # Detects function with too many results. # https://go-critic.com/overview.html#toomanyresultschecker - tooManyResultsChecker # Detects potential truncation issues when comparing ints of different sizes. # https://go-critic.com/overview.html#truncatecmp - truncateCmp # Detects repeated type assertions and suggests to replace them with type switch statement. # https://go-critic.com/overview.html#typeassertchain - typeAssertChain # Detects method declarations preceding the type definition itself. # https://go-critic.com/overview.html#typedeffirst - typeDefFirst # Detects type switches that can benefit from type guard clause with variable. # https://go-critic.com/overview.html#typeswitchvar - typeSwitchVar # Detects unneeded parenthesis inside type expressions and suggests to remove them. # https://go-critic.com/overview.html#typeunparen - typeUnparen # Detects unchecked errors in if statements. # https://go-critic.com/overview.html#uncheckedinlineerr - uncheckedInlineErr # Detects dereference expressions that can be omitted. # https://go-critic.com/overview.html#underef - underef # Detects redundant statement labels. # https://go-critic.com/overview.html#unlabelstmt - unlabelStmt # Detects function literals that can be simplified. # https://go-critic.com/overview.html#unlambda - unlambda # Detects unnamed results that may benefit from names. # https://go-critic.com/overview.html#unnamedresult - unnamedResult # Detects unnecessary braced statement blocks. # https://go-critic.com/overview.html#unnecessaryblock - unnecessaryBlock # Detects redundantly deferred calls. # https://go-critic.com/overview.html#unnecessarydefer - unnecessaryDefer # Detects slice expressions that can be simplified to sliced expression itself. # https://go-critic.com/overview.html#unslice - unslice # Detects value swapping code that are not using parallel assignment. # https://go-critic.com/overview.html#valswap - valSwap # Detects conditions that are unsafe due to not being exhaustive. # https://go-critic.com/overview.html#weakcond - weakCond # Ensures that `//nolint` comments include an explanation. # https://go-critic.com/overview.html#whynolint - whyNoLint # Detects function calls that can be replaced with convenience wrappers. # https://go-critic.com/overview.html#wrapperfunc - wrapperFunc # Detects Yoda style expressions and suggests to replace them. # https://go-critic.com/overview.html#yodastyleexpr - yodaStyleExpr # Detects bytes.Repeat with 0 value. # https://go-critic.com/overview.html#zerobyterepeat - zeroByteRepeat # Enable all checks. # Default: false enable-all: true # Which checks should be disabled; can't be combined with 'enabled-checks'. # Default: [] disabled-checks: - appendAssign - appendCombine - argOrder - assignOp - badCall - badCond - badLock - badRegexp - badSorting - badSyncOnceFunc - boolExprSimplify - builtinShadow - builtinShadowDecl - captLocal - caseOrder - codegenComment - commentFormatting - commentedOutCode - commentedOutImport - defaultCaseOrder - deferInLoop - deferUnlambda - deprecatedComment - docStub - dupArg - dupBranchBody - dupCase - dupImport - dupSubExpr - dynamicFmtString - elseif - emptyDecl - emptyFallthrough - emptyStringTest - equalFold - evalOrder - exitAfterDefer - exposedSyncMutex - externalErrorReassign - filepathJoin - flagDeref - flagName - hexLiteral - httpNoBody - hugeParam - ifElseChain - importShadow - indexAlloc - initClause - mapKey - methodExprCall - nestingReduce - newDeref - nilValReturn - octalLiteral - offBy1 - paramTypeCombine - preferDecodeRune - preferFilepathJoin - preferFprint - preferStringWriter - preferWriteByte - ptrToRefParam - rangeAppendAll - rangeExprCopy - rangeValCopy - redundantSprint - regexpMust - regexpPattern - regexpSimplify - returnAfterHttpError - ruleguard - singleCaseSwitch - sliceClear - sloppyLen - sloppyReassign - sloppyTypeAssert - sortSlice - sprintfQuotedString - sqlQuery - stringConcatSimplify - stringXbytes - stringsCompare - switchTrue - syncMapLoadAndDelete - timeExprSimplify - todoCommentWithoutDetail - tooManyResultsChecker - truncateCmp - typeAssertChain - typeDefFirst - typeSwitchVar - typeUnparen - uncheckedInlineErr - underef - unlabelStmt - unlambda - unnamedResult - unnecessaryBlock - unnecessaryDefer - unslice - valSwap - weakCond - whyNoLint - wrapperFunc - yodaStyleExpr # Enable multiple checks by tags in addition to default checks. # Run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic` to see all tags and checks. # See https://github.com/go-critic/go-critic#usage -> section "Tags". # Default: [] enabled-tags: - diagnostic - style - performance - experimental - opinionated disabled-tags: - diagnostic - style - performance - experimental - opinionated # Settings passed to gocritic. # The settings key is the name of a supported gocritic checker. # The list of supported checkers can be found at https://go-critic.com/overview. settings: # Must be valid enabled check name. captLocal: # Whether to restrict checker to params only. # Default: true paramsOnly: false commentedOutCode: # Min length of the comment that triggers a warning. # Default: 15 minLength: 50 elseif: # Whether to skip balanced if-else pairs. # Default: true skipBalanced: false hugeParam: # Size in bytes that makes the warning trigger. # Default: 80 sizeThreshold: 70 ifElseChain: # Min number of if-else blocks that makes the warning trigger. # Default: 2 minThreshold: 4 nestingReduce: # Min number of statements inside a branch to trigger a warning. # Default: 5 bodyWidth: 4 rangeExprCopy: # Size in bytes that makes the warning trigger. # Default: 512 sizeThreshold: 516 # Whether to check test functions # Default: true skipTestFuncs: false rangeValCopy: # Size in bytes that makes the warning trigger. # Default: 128 sizeThreshold: 32 # Whether to check test functions. # Default: true skipTestFuncs: false ruleguard: # Enable debug to identify which 'Where' condition was rejected. # The value of the parameter is the name of a function in a ruleguard file. # # When a rule is evaluated: # If: # The Match() clause is accepted; and # One of the conditions in the Where() clause is rejected, # Then: # ruleguard prints the specific Where() condition that was rejected. # # The option is passed to the ruleguard 'debug-group' argument. # Default: "" debug: 'emptyDecl' # Determines the behavior when an error occurs while parsing ruleguard files. # If flag is not set, log error and skip rule files that contain an error. # If flag is set, the value must be a comma-separated list of error conditions. # - 'all': fail on all errors. # - 'import': ruleguard rule imports a package that cannot be found. # - 'dsl': gorule file does not comply with the ruleguard DSL. # Default: "" failOn: dsl,import # Comma-separated list of file paths containing ruleguard rules. # By default, if a path is relative, it is relative to the directory where the golangci-lint command is executed. # The placeholder '${base-path}' is substituted with a path relative to the mode defined with `run.relative-path-mode`. # The placeholder '${config-path}' is substituted with a path relative to the configuration file. # Glob patterns such as 'rules-*.go' may be specified. # Default: "" rules: '${base-path}/ruleguard/rules-*.go,${base-path}/myrule1.go' # Comma-separated list of enabled groups or skip empty to enable everything. # Tags can be defined with # character prefix. # Default: "" enable: "myGroupName,#myTagName" # Comma-separated list of disabled groups or skip empty to enable everything. # Tags can be defined with # character prefix. # Default: "" disable: "myGroupName,#myTagName" tooManyResultsChecker: # Maximum number of results. # Default: 5 maxResults: 10 truncateCmp: # Whether to skip int/uint/uintptr types. # Default: true skipArchDependent: false underef: # Whether to skip (*x).method() calls where x is a pointer receiver. # Default: true skipRecvDeref: false unnamedResult: # Whether to check exported functions. # Default: false checkExported: true gocyclo: # Minimal code complexity to report. # Default: 30 (but we recommend 10-20) min-complexity: 10 godoclint: # Default set of rules to enable. # Possible values are: `basic`, `all` or `none`. # Default: `basic` (enables `pkg-doc`, `single-pkg-doc`, `start-with-name`, and `deprecated`) default: all # List of rules to enable in addition to the default set. # Default: empty enable: # Check proper package-level godoc, if any. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#pkg-doc - pkg-doc # Assert at most one godoc per package. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#single-pkg-doc - single-pkg-doc # Require all packages to have a godoc. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-pkg-doc - require-pkg-doc # Assert symbol godocs start with the symbol name. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#start-with-name - start-with-name # Require godoc for all public symbols. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-doc - require-doc # Assert correct formatting of deprecation notes. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#deprecated - deprecated # Assert maximum line length for godocs. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#max-len - max-len # Assert no unused link in godocs. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#no-unused-link - no-unused-link # Require proper doc links to standard library declarations where applicable. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-stdlib-doclink - require-stdlib-doclink # List of rules to disable. # Default: empty disable: - pkg-doc - single-pkg-doc - require-pkg-doc - start-with-name - require-doc - deprecated - max-len - no-unused-link - require-stdlib-doclink # A map for fine-tuning individual rules. # All subkeys are optional. options: max-len: # Maximum line length for godocs, not including the `//`, `/*` or `*/` tokens. # Default: 77 length: 127 require-doc: # Ignore exported (public) symbols when applying the `require-doc` rule. # Default: false ignore-exported: true # Ignore unexported (private) symbols when applying the `require-doc` rule. # Default: true ignore-unexported: false start-with-name: # Include unexported symbols when applying the `start-with-name` rule. # Default: false include-unexported: true godot: # Comments to be checked: `declarations`, `toplevel`, `noinline` or `all`. # Default: declarations scope: toplevel # List of regexps for excluding particular comment lines from check. # Default: [] exclude: # Exclude todo and fixme comments. - "^fixme:" - "^todo:" # Check that each sentence ends with a period. # Default: true period: false # Check that each sentence starts with a capital letter. # Default: false capital: true godox: # Report any comments starting with keywords, this is useful for TODO or FIXME comments that # might be left in the code accidentally and should be resolved before merging. # Default: ["TODO", "BUG", "FIXME"] keywords: - NOTE - OPTIMIZE # marks code that should be optimized before merging - HACK # marks hack-around that should be removed before merging goheader: # Supports two types 'const` and `regexp`. # Values can be used recursively. # Default: {} values: const: # Define here const type values in format k:v. # For example: COMPANY: MY COMPANY regexp: # Define here regexp type values. # for example: AUTHOR: .*@mycompany\.com # The template used for checking. # Put here copyright header template for source code files. # Note: {{ YEAR }} is a builtin value that returns the year relative to the current machine time. # Default: "" template: |- {{ AUTHOR }} {{ COMPANY }} {{ YEAR }} SPDX-License-Identifier: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. # As alternative of directive 'template', you may put the path to file with the template source. # Useful if you need to load the template from a specific file. # By default, if a path is relative, it is relative to the directory where the golangci-lint command is executed. # The placeholder '${base-path}' is substituted with a path relative to the mode defined with `run.relative-path-mode`. # The placeholder '${config-path}' is substituted with a path relative to the configuration file. # Default: "" template-path: /path/to/my/template.tmpl gomoddirectives: # Allow local `replace` directives. # Default: false replace-local: true # List of allowed `replace` directives. # Default: [] replace-allow-list: - launchpad.net/gocheck # Allow to not explain why the version has been retracted in the `retract` directives. # Default: false retract-allow-no-explanation: true # Forbid the use of the `exclude` directives. # Default: false exclude-forbidden: true # Forbid the use of the `ignore` directives (>= go1.25). # Default: false ignore-forbidden: true # Forbid the use of the `toolchain` directive. # Default: false toolchain-forbidden: true # Defines a pattern to validate `toolchain` directive. # Default: '' (no match) toolchain-pattern: 'go1\.23\.\d+$' # Forbid the use of the `tool` directives. # Default: false tool-forbidden: true # Forbid the use of the `godebug` directive. # Default: false go-debug-forbidden: true # Defines a pattern to validate `go` minimum version directive. # Default: '' (no match) go-version-pattern: '\d\.\d+(\.0)?' # Check the validity of the module path. # Default: false check-module-path: true gomodguard: allowed: # List of allowed modules. # Default: [] modules: - gopkg.in/yaml.v2 # List of allowed module domains. # Default: [] domains: - golang.org blocked: # List of blocked modules. # Default: [] modules: # Blocked module. - github.com/uudashr/go-module: # Recommended modules that should be used instead. (Optional) recommendations: - golang.org/x/mod # Reason why the recommended module should be used. (Optional) reason: "`mod` is the official go.mod parser library." # List of blocked module version constraints. # Default: [] versions: # Blocked module with version constraint. - github.com/mitchellh/go-homedir: # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons. version: "< 1.1.0" # Reason why the version constraint exists. (Optional) reason: "testing if blocked version constraint works." # Set to true to raise lint issues for packages that are loaded from a local path via replace directive. # Default: false local-replace-directives: false gosec: # To select a subset of rules to run. # Available rules: https://github.com/securego/gosec#available-rules # Default: [] - means include all rules includes: - G101 # Look for hardcoded credentials - G102 # Bind to all interfaces - G103 # Audit the use of unsafe block - G104 # Audit errors not checked - G106 # Audit the use of ssh.InsecureIgnoreHostKey function - G107 # Url provided to HTTP request as taint input - G108 # Profiling endpoint is automatically exposed - G109 # Converting strconv.Atoi result to int32/int16 - G110 # Detect io.Copy instead of io.CopyN when decompression - G111 # Detect http.Dir('/') as a potential risk - G112 # Detect ReadHeaderTimeout not configured as a potential risk - G113 # HTTP request smuggling via conflicting headers or bare LF in body parsing - G114 # Use of net/http serve function that has no support for setting timeouts - G115 # Type conversion which leads to integer overflow - G116 # Detect Trojan Source attacks using bidirectional Unicode characters - G117 # Potential exposure of secrets via JSON/YAML/XML/TOML marshaling - G118 # Context propagation failure leading to goroutine/resource leaks - G119 # Unsafe redirect policy may propagate sensitive headers - G120 # Unbounded form parsing in HTTP handlers can cause memory exhaustion - G121 # Unsafe CrossOriginProtection bypass patterns - G122 # Filesystem TOCTOU race risk in filepath.Walk/WalkDir callbacks - G123 # TLS resumption may bypass VerifyPeerCertificate when VerifyConnection is unset - G201 # SQL query construction using format string - G202 # SQL query construction using string concatenation - G203 # Use of unescaped data in HTML templates - G204 # Audit use of command execution - G301 # Poor file permissions used when creating a directory - G302 # Poor file permissions used when creation file or using chmod - G303 # Creating tempfile using a predictable path - G304 # File path provided as taint input - G305 # File path traversal when extracting zip archive - G306 # Poor file permissions used when writing to a file - G307 # Poor file permissions used when creating a file with os.Create - G401 # Detect the usage of MD5 or SHA1 - G402 # Look for bad TLS connection settings - G403 # Ensure minimum RSA key length of 2048 bits - G404 # Insecure random number source (rand) - G405 # Detect the usage of DES or RC4 - G406 # Detect the usage of deprecated MD4 or RIPEMD160 - G408 # Stateful misuse of ssh.PublicKeyCallback leading to auth bypass - G501 # Import blocklist: crypto/md5 - G502 # Import blocklist: crypto/des - G503 # Import blocklist: crypto/rc4 - G504 # Import blocklist: net/http/cgi - G505 # Import blocklist: crypto/sha1 - G506 # Import blocklist: golang.org/x/crypto/md4 - G507 # Import blocklist: golang.org/x/crypto/ripemd160 - G601 # Implicit memory aliasing in RangeStmt - G602 # Possible slice bounds out of range - G701 # SQL injection via taint analysis - G702 # Command injection via taint analysis - G703 # Path traversal via taint analysis - G704 # SSRF via taint analysis - G705 # XSS via taint analysis - G706 # Log injection via taint analysis - G707 # SMTP command/header injection via taint analysis # To specify a set of rules to explicitly exclude. # Available rules: https://github.com/securego/gosec#available-rules # Default: [] excludes: - G101 # Look for hardcoded credentials - G102 # Bind to all interfaces - G103 # Audit the use of unsafe block - G104 # Audit errors not checked - G106 # Audit the use of ssh.InsecureIgnoreHostKey function - G107 # Url provided to HTTP request as taint input - G108 # Profiling endpoint is automatically exposed - G109 # Converting strconv.Atoi result to int32/int16 - G110 # Detect io.Copy instead of io.CopyN when decompression - G111 # Detect http.Dir('/') as a potential risk - G112 # Detect ReadHeaderTimeout not configured as a potential risk - G114 # Use of net/http serve function that has no support for setting timeouts - G115 # Type conversion which leads to integer overflow - G116 # Detect Trojan Source attacks using bidirectional Unicode characters - G201 # SQL query construction using format string - G202 # SQL query construction using string concatenation - G203 # Use of unescaped data in HTML templates - G204 # Audit use of command execution - G301 # Poor file permissions used when creating a directory - G302 # Poor file permissions used when creation file or using chmod - G303 # Creating tempfile using a predictable path - G304 # File path provided as taint input - G305 # File path traversal when extracting zip archive - G306 # Poor file permissions used when writing to a file - G307 # Poor file permissions used when creating a file with os.Create - G401 # Detect the usage of MD5 or SHA1 - G402 # Look for bad TLS connection settings - G403 # Ensure minimum RSA key length of 2048 bits - G404 # Insecure random number source (rand) - G405 # Detect the usage of DES or RC4 - G406 # Detect the usage of deprecated MD4 or RIPEMD160 - G501 # Import blocklist: crypto/md5 - G502 # Import blocklist: crypto/des - G503 # Import blocklist: crypto/rc4 - G504 # Import blocklist: net/http/cgi - G505 # Import blocklist: crypto/sha1 - G506 # Import blocklist: golang.org/x/crypto/md4 - G507 # Import blocklist: golang.org/x/crypto/ripemd160 - G601 # Implicit memory aliasing in RangeStmt - G602 # Possible slice bounds out of range # Filter out the issues with a lower severity than the given value. # Valid options are: low, medium, high. # Default: low severity: medium # Filter out the issues with a lower confidence than the given value. # Valid options are: low, medium, high. # Default: low confidence: medium # Concurrency value. # Default: the number of logical CPUs usable by the current process. concurrency: 12 # To specify the configuration of rules. config: # Globals are applicable to all rules. global: # If true, ignore #nosec in comments (and an alternative as well). # Default: false nosec: true # Add an alternative comment prefix to #nosec (both will work at the same time). # Default: "" "#nosec": "#my-custom-nosec" # Define whether nosec issues are counted as finding or not. # Default: false show-ignored: true # Audit mode enables addition checks that for normal code analysis might be too nosy. # Default: false audit: true G101: # Regexp pattern for variables and constants to find. # Default: "(?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|cred" pattern: "(?i)example" # If true, complain about all cases (even with low entropy). # Default: false ignore_entropy: false # Maximum allowed entropy of the string. # Default: "80.0" entropy_threshold: "80.0" # Maximum allowed value of entropy/string length. # Is taken into account if entropy >= entropy_threshold/2. # Default: "3.0" per_char_threshold: "3.0" # Calculate entropy for first N chars of the string. # Default: "16" truncate: "32" # Additional functions to ignore while checking unhandled errors. # Following functions always ignored: # bytes.Buffer: # - Write # - WriteByte # - WriteRune # - WriteString # fmt: # - Print # - Printf # - Println # - Fprint # - Fprintf # - Fprintln # strings.Builder: # - Write # - WriteByte # - WriteRune # - WriteString # io.PipeWriter: # - CloseWithError # hash.Hash: # - Write # os: # - Unsetenv # Default: {} G104: fmt: - Fscanf G111: # Regexp pattern to find potential directory traversal. # Default: "http\\.Dir\\(\"\\/\"\\)|http\\.Dir\\('\\/'\\)" pattern: "custom\\.Dir\\(\\)" # Maximum allowed permissions mode for os.Mkdir and os.MkdirAll. # Default: "0750" G301: "0750" # Maximum allowed permissions mode for os.OpenFile and os.Chmod. # Default: "0600" G302: "0600" # Maximum allowed permissions mode for os.WriteFile and ioutil.WriteFile. # Default: "0600" G306: "0600" gosmopolitan: # Allow and ignore `time.Local` usages. # # Default: false allow-time-local: true # List of fully qualified names in the `full/pkg/path.name` form, to act as "i18n escape hatches". # String literals inside call-like expressions to, or struct literals of those names, # are exempt from the writing system check. # # Default: [] escape-hatches: - 'github.com/nicksnyder/go-i18n/v2/i18n.Message' - 'example.com/your/project/i18n/markers.Raw' - 'example.com/your/project/i18n/markers.OK' - 'example.com/your/project/i18n/markers.TODO' - 'command-line-arguments.Simple' # List of Unicode scripts to watch for any usage in string literals. # https://pkg.go.dev/unicode#pkg-variables # # Default: ["Han"] watch-for-scripts: - Devanagari - Han - Hangul - Hiragana - Katakana govet: # Disable all analyzers. # Default: false disable-all: true # Enable analyzers by name. # (In addition to default: # appends, asmdecl, assign, atomic, bools, buildtag, cgocall, composites, copylocks, defers, directive, errorsas, # framepointer, httpresponse, ifaceassert, loopclosure, lostcancel, nilfunc, printf, shift, sigchanyzer, slog, # stdmethods, stringintconv, structtag, testinggoroutine, tests, timeformat, unmarshal, unreachable, unsafeptr, # unusedresult # ). # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers. # Default: [] enable: # Check for missing values after append. - appends # Report mismatches between assembly files and Go declarations. - asmdecl # Check for useless assignments. - assign # Check for common mistakes using the sync/atomic package. - atomic # Check for non-64-bits-aligned arguments to sync/atomic functions. - atomicalign # Check for common mistakes involving boolean operators. - bools # Check //go:build and // +build directives. - buildtag # Detect some violations of the cgo pointer passing rules. - cgocall # Check for unkeyed composite literals. - composites # Check for locks erroneously passed by value. - copylocks # Check for calls of reflect.DeepEqual on error values. - deepequalerrors # Report common mistakes in defer statements. - defers # Check Go toolchain directives such as //go:debug. - directive # Report passing non-pointer or non-error values to errors.As. - errorsas # Find structs that would use less memory if their fields were sorted. - fieldalignment # Find calls to a particular function. - findcall # Report assembly that clobbers the frame pointer before saving it. - framepointer # Check format of addresses passed to net.Dial. - hostport # Report using Go 1.22 enhanced ServeMux patterns in older Go versions. - httpmux # Check for mistakes using HTTP responses. - httpresponse # Detect impossible interface-to-interface type assertions. - ifaceassert # Check references to loop variables from within nested functions. - loopclosure # Check cancel func returned by context.WithCancel is called. - lostcancel # Check for useless comparisons between functions and nil. - nilfunc # Check for redundant or impossible nil comparisons. - nilness # Check consistency of Printf format strings and arguments. - printf # Check for comparing reflect.Value values with == or reflect.DeepEqual. - reflectvaluecompare # Check for possible unintended shadowing of variables. - shadow # Check for shifts that equal or exceed the width of the integer. - shift # Check for unbuffered channel of os.Signal. - sigchanyzer # Check for invalid structured logging calls. - slog # Check the argument type of sort.Slice. - sortslice # Check signature of methods of well-known interfaces. - stdmethods # Report uses of too-new standard library symbols. - stdversion # Check for string(int) conversions. - stringintconv # Check that struct field tags conform to reflect.StructTag.Get. - structtag # Report calls to (*testing.T).Fatal from goroutines started by a test. - testinggoroutine # Check for common mistaken usages of tests and examples. - tests # Check for calls of (time.Time).Format or time.Parse with 2006-02-01. - timeformat # Report passing non-pointer or non-interface values to unmarshal. - unmarshal # Check for unreachable code. - unreachable # Check for invalid conversions of uintptr to unsafe.Pointer. - unsafeptr # Check for unused results of calls to some functions. - unusedresult # Checks for unused writes. - unusedwrite # Check for misuses of sync.WaitGroup. - waitgroup # Enable all analyzers. # Default: false enable-all: true # Disable analyzers by name. # (In addition to default # atomicalign, deepequalerrors, fieldalignment, findcall, nilness, reflectvaluecompare, shadow, sortslice, # timeformat, unusedwrite # ). # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers. # Default: [] disable: - appends - asmdecl - assign - atomic - atomicalign - bools - buildtag - cgocall - composites - copylocks - deepequalerrors - defers - directive - errorsas - fieldalignment - findcall - framepointer - hostport - httpmux - httpresponse - ifaceassert - loopclosure - lostcancel - nilfunc - nilness - printf - reflectvaluecompare - shadow - shift - sigchanyzer - slog - sortslice - stdmethods - stdversion - stringintconv - structtag - testinggoroutine - tests - timeformat - unmarshal - unreachable - unsafeptr - unusedresult - unusedwrite - waitgroup # Settings per analyzer. settings: # Analyzer name, run `go tool vet help` to see all analyzers. printf: # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). # Default: [] funcs: - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Infof - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Warnf - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Errorf - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Fatalf shadow: # Whether to be strict about shadowing; can be noisy. # Default: false strict: true unusedresult: # Comma-separated list of functions whose results must be used. # (In addition to default: # context.WithCancel, context.WithDeadline, context.WithTimeout, context.WithValue, errors.New, fmt.Errorf, # fmt.Sprint, fmt.Sprintf, sort.Reverse # ). # Default: [] funcs: - pkg.MyFunc # Comma-separated list of names of methods of type func() string whose results must be used. # (In addition to default Error,String). # Default: [] stringmethods: - MyMethod grouper: # Require the use of a single global 'const' declaration only. # Default: false const-require-single-const: true # Require the use of grouped global 'const' declarations. # Default: false const-require-grouping: true # Require the use of a single 'import' declaration only. # Default: false import-require-single-import: true # Require the use of grouped 'import' declarations. # Default: false import-require-grouping: true # Require the use of a single global 'type' declaration only. # Default: false type-require-single-type: true # Require the use of grouped global 'type' declarations. # Default: false type-require-grouping: true # Require the use of a single global 'var' declaration only. # Default: false var-require-single-var: true # Require the use of grouped global 'var' declarations. # Default: false var-require-grouping: true iface: # List of analyzers. # Default: ["identical"] enable: - identical # Identifies interfaces in the same package that have identical method sets. - unused # Identifies interfaces that are not used anywhere in the same package where the interface is defined. - opaque # Identifies functions that return interfaces, but the actual returned value is always a single concrete implementation. - unexported # Identifies interfaces that are not exported but are used in exported functions or methods. settings: unused: # List of packages path to exclude from the check. # Default: [] exclude: - github.com/example/log importas: # Do not allow unaliased imports of aliased packages. # Default: false no-unaliased: true # Do not allow non-required aliases. # Default: false no-extra-aliases: true # List of aliases # Default: [] alias: # Using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package. - pkg: knative.dev/serving/pkg/apis/serving/v1 alias: servingv1 # Using `autoscalingv1alpha1` alias for `knative.dev/serving/pkg/apis/autoscaling/v1alpha1` package. - pkg: knative.dev/serving/pkg/apis/autoscaling/v1alpha1 alias: autoscalingv1alpha1 # You can specify the package path by regular expression, # and alias by regular expression expansion syntax like below. # See https://github.com/julz/importas#use-regular-expression for details. - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+) alias: $1$2 # An explicit empty alias can be used to ensure no aliases are used for a package. # This can be useful if `no-extra-aliases: true` doesn't fit your need. # Multiple packages can use an empty alias. - pkg: errors alias: "" inamedparam: # Skips check for interface methods with only a single parameter. # Default: false skip-single-param: true ineffassign: # Check escaping variables of type error, may cause false positives. # Default: false check-escaping-errors: true interfacebloat: # The maximum number of methods allowed for an interface. # Default: 10 max: 5 iotamixing: # Whether to report individual consts rather than just the const block. # Default: false report-individual: true ireturn: # List of interfaces to allow. # Lists of the keywords and regular expressions matched to interface or package names can be used. # `allow` and `reject` settings cannot be used at the same time. # # Keywords: # - `empty` for `interface{}` # - `error` for errors # - `stdlib` for standard library # - `anon` for anonymous interfaces # - `generic` for generic interfaces added in go 1.18 # # Default: [anon, error, empty, stdlib] allow: - anon # You can specify idiomatic endings for interface - (or|er)$ # List of interfaces to reject. # Lists of the keywords and regular expressions matched to interface or package names can be used. # `allow` and `reject` settings cannot be used at the same time. # # Keywords: # - `empty` for `interface{}` # - `error` for errors # - `stdlib` for standard library # - `anon` for anonymous interfaces # - `generic` for generic interfaces added in go 1.18 # # Default: [] reject: - github.com\/user\/package\/v4\.Type lll: # Max line length, lines longer will be reported. # '\t' is counted as 1 character by default, and can be changed with the tab-width option. # Default: 120. line-length: 120 # Tab width in spaces. # Default: 1 tab-width: 1 loggercheck: # Allow check for the github.com/go-kit/log library. # Default: true kitlog: false # Allow check for the k8s.io/klog/v2 library. # Default: true klog: false # Allow check for the github.com/go-logr/logr library. # Default: true logr: false # Allow check for the log/slog library. # Default: true slog: false # Allow check for the "sugar logger" from go.uber.org/zap library. # Default: true zap: false # Require all logging keys to be inlined constant strings. # Default: false require-string-key: true # Require printf-like format specifier (%s, %d for example) not present. # Default: false no-printf-like: true # List of custom rules to check against, where each rule is a single logger pattern, useful for wrapped loggers. # For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt # Default: empty rules: - k8s.io/klog/v2.InfoS # package level exported functions - (github.com/go-logr/logr.Logger).Error # "Methods" - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver maintidx: # Show functions with maintainability index lower than N. # A high index indicates better maintainability (it's kind of the opposite of complexity). # Default: 20 under: 100 makezero: # Allow only slices initialized with a length of zero. # Default: false always: true misspell: # Correct spellings using locale preferences for US or UK. # Setting locale to US will correct the British spelling of 'colour' to 'color'. # Default is to use a neutral variety of English. locale: US # Typos to ignore. # Should be in lower case. # Default: [] ignore-rules: - someword # Extra word corrections. # `typo` and `correction` should only contain letters. # The words are case-insensitive. # Default: [] extra-words: - typo: "iff" correction: "if" - typo: "cancelation" correction: "cancellation" # Mode of the analysis: # - default: checks all the file content. # - restricted: checks only comments. # Default: "" mode: restricted mnd: # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. # Default: ["argument", "case", "condition", "operation", "return", "assign"] checks: - argument - case - condition - operation - return - assign # List of numbers to exclude from analysis. # The numbers should be written as string. # Values always ignored: "1", "1.0", "0" and "0.0". # Default: [] ignored-numbers: - '0666' - '0755' - '42' # List of file patterns to exclude from analysis. # Values always ignored: `.+_test.go`. # Default: [] ignored-files: - 'magic1_.+\.go$' # List of function patterns to exclude from analysis. # Following functions are always ignored: `time.Date`, # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`, # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`. # Default: [] ignored-functions: - '^math\.' - '^http\.StatusText$' modernize: # List of analyzers to disable. # By default, all analyzers are enabled. disable: # Replace interface{} with any. - any # Replace []byte(fmt.Sprintf) with fmt.Appendf. - fmtappendf # Remove redundant re-declaration of loop variables. - forvar # Replace explicit loops over maps with calls to maps package. - mapsloop # Replace if/else statements with calls to min or max. - minmax # Simplify code by using go1.26's new(expr). - newexpr # Suggest replacing omitempty with omitzero for struct fields. - omitzero # Remove obsolete //+build comments. - plusbuild # Replace 3-clause for loops with for-range over integers. - rangeint # Replace reflect.TypeOf(x) with TypeFor[T](). - reflecttypefor # Replace loops with slices.Contains or slices.ContainsFunc. - slicescontains # Replace sort.Slice with slices.Sort for basic types. - slicessort # Use iterators instead of Len/At-style APIs. - stditerators # Replace strings.Index etc. with strings.Cut. - stringscut # Replace HasPrefix/TrimPrefix with CutPrefix. - stringscutprefix # Replace ranging over Split/Fields with SplitSeq/FieldsSeq. - stringsseq # Replace += with strings.Builder. - stringsbuilder # Replace context.WithCancel with t.Context in tests. - testingcontext # Replace unsafe pointer arithmetic with function calls. - unsafefuncs # Replace wg.Add(1)/go/wg.Done() with wg.Go. - waitgroup musttag: # A set of custom functions to check in addition to the builtin ones. # Default: json, xml, gopkg.in/yaml.v3, BurntSushi/toml, mitchellh/mapstructure, jmoiron/sqlx functions: # The full name of the function, including the package. - name: github.com/hashicorp/hcl/v2/hclsimple.DecodeFile # The struct tag whose presence should be ensured. tag: hcl # The position of the argument to check. arg-pos: 2 nakedret: # Make an issue if func has more lines of code than this setting, and it has naked returns. # Default: 30 max-func-lines: 31 nestif: # Minimal complexity of if statements to report. # Default: 5 min-complexity: 4 nilnil: # To check functions with only two return values (`return nil, nil`). # If disabled then returns like `return nil, nil, ..., nil` are supported. # Default: true only-two: false # In addition, detect opposite situation (simultaneous return of non-nil error and valid value). # E.g, `return clone, fh.indexer.Update(clone)` will be considered as invalid. # Default: false detect-opposite: true # List of return types to check. # Default: ["chan", "func", "iface", "map", "ptr", "uintptr", "unsafeptr"] checked-types: - chan - func - iface - map - ptr - uintptr - unsafeptr nlreturn: # Size of the block (including return statement that is still "OK"), # so no return split required. # Default: 1 block-size: 2 nolintlint: # Disable to ensure that all nolint directives actually have an effect. # Default: false allow-unused: true # Exclude following linters from requiring an explanation. # Default: [] allow-no-explanation: [ ] # Enable to require an explanation of nonzero length after each nolint directive. # Default: false require-explanation: true # Enable to require nolint directives to mention the specific linter being suppressed. # Default: false require-specific: true nonamedreturns: # Report named error if it is assigned inside defer. # Default: false report-error-in-defer: true paralleltest: # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it. # Default: false ignore-missing: true # Ignore missing calls to `t.Parallel()` in subtests. Top-level tests are # still required to have `t.Parallel`, but subtests are allowed to skip it. # Default: false ignore-missing-subtests: true perfsprint: # Enable/disable optimization of integer formatting. # Default: true integer-format: false # Optimizes even if it requires an int or uint type cast. # Default: true int-conversion: false # Enable/disable optimization of error formatting. # Default: true error-format: false # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors. # Default: false err-error: true # Optimizes `fmt.Errorf`. # Default: true errorf: false # Enable/disable optimization of string formatting. # Default: true string-format: false # Optimizes `fmt.Sprintf` with only one argument. # Default: true sprintf1: false # Optimizes into strings concatenation. # Default: true strconcat: false # Enable/disable optimization of bool formatting. # Default: true bool-format: false # Enable/disable optimization of hex formatting. # Default: true hex-format: false # Enable/disable optimization of concat loop. # Default: true concat-loop: false # Optimization of `concat-loop` even with other operations. # Default: false loop-other-ops: true prealloc: # IMPORTANT: we don't recommend using this linter before doing performance profiling. # For most programs usage of prealloc will be a premature optimization. # Report pre-allocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. # Default: true simple: false # Report pre-allocation suggestions on range loops. # Default: true range-loops: false # Report pre-allocation suggestions on for loops. # Default: false for-loops: true predeclared: # List of predeclared identifiers to not report on. # Default: [] ignore: - new - int # Include method names and field names in checks. # Default: false qualified-name: true promlinter: # Promlinter cannot infer all metrics name in static analysis. # Enable strict mode will also include the errors caused by failing to parse the args. # Default: false strict: true # Please refer to https://github.com/yeya24/promlinter#usage for detailed usage. # Default: [] disabled-linters: # Help detects issues related to the help text for a metric. - Help # MetricUnits detects issues with metric unit names. - MetricUnits # Counter detects issues specific to counters, as well as patterns that should only be used with counters. - Counter # HistogramSummaryReserved detects when other types of metrics use names or labels reserved for use by histograms and/or summaries. - HistogramSummaryReserved # MetricTypeInName detects when metric types are included in the metric name. - MetricTypeInName # ReservedChars detects colons in metric names. - ReservedChars # CamelCase detects metric names and label names written in camelCase. - CamelCase # UnitAbbreviations detects abbreviated units in the metric name. - UnitAbbreviations protogetter: # Skip files generated by specified generators from the checking. # Checks only the file's initial comment, which must follow the format: "// Code generated by ". # Files generated by protoc-gen-go, protoc-gen-go-grpc, and protoc-gen-grpc-gateway are always excluded automatically. # Default: [] skip-generated-by: ["protoc-gen-go-my-own-generator"] # Skip files matching the specified glob pattern from the checking. # Default: [] skip-files: - "*.pb.go" - "*/vendor/*" - "/full/path/to/file.go" # Skip any generated files from the checking. # Default: false skip-any-generated: true # Skip first argument of append function. # Default: false replace-first-arg-in-append: true reassign: # Patterns for global variable names that are checked for reassignment. # See https://github.com/curioswitch/go-reassign#usage # Default: ["EOF", "Err.*"] patterns: - ".*" recvcheck: # Disables the built-in method exclusions: # - `MarshalText` # - `MarshalJSON` # - `MarshalYAML` # - `MarshalXML` # - `MarshalBinary` # - `GobEncode` # Default: false disable-builtin: true # User-defined method exclusions. # The format is `struct_name.method_name` (ex: `Foo.MethodName`). # A wildcard `*` can use as a struct name (ex: `*.MethodName`). # Default: [] exclusions: - "*.Value" revive: # Maximum number of open files at the same time. # See https://github.com/mgechev/revive#command-line-flags # Defaults to unlimited. max-open-files: 2048 # Sets the default severity. # See https://github.com/mgechev/revive#configuration # Default: warning severity: error # Enable all available rules. # Default: false enable-all-rules: true # By default, the default rules are enabled, # but if you explicitly define or configure a rule, the default rules will be disabled. # This option, when set to `true`, allows you to avoid explicitly redefining default rules when adding a rule. # Default: false enable-default-rules: true # Enable validation of comment directives. # See https://github.com/mgechev/revive#comment-directives directives: - name: specify-disable-reason severity: error # Sets the default failure confidence. # This means that linting errors with less than 0.8 confidence will be ignored. # Default: 0.8 confidence: 0.1 # Revive handles the default rules in a way that can be unexpected: # - If there are no explicit rules, the default rules are used. # - If there is at least one explicit rule, the default rules are not used, unless `enable-default-rules` is `true`. # Run `GL_DEBUG=revive golangci-lint run --enable-only=revive` to see default, all available rules, and enabled rules. rules: # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#add-constant - name: add-constant severity: warning disabled: false exclude: [""] arguments: - max-lit-count: "3" allow-strs: '""' allow-ints: "0,1,2" allow-floats: "0.0,0.,1.0,1.,2.0,2." # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#argument-limit - name: argument-limit severity: warning disabled: false exclude: [""] arguments: [ 4 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#atomic - name: atomic severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#banned-characters - name: banned-characters severity: warning disabled: false exclude: [""] arguments: [ "Ω","Σ","σ", "7" ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#bare-return - name: bare-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#blank-imports - name: blank-imports severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#bool-literal-in-expr - name: bool-literal-in-expr severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#call-to-gc - name: call-to-gc severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#cognitive-complexity - name: cognitive-complexity severity: warning disabled: false exclude: [""] arguments: [ 7 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#comment-spacings - name: comment-spacings severity: warning disabled: false exclude: [""] arguments: - mypragma - otherpragma # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#comments-density - name: comments-density severity: warning disabled: false exclude: [""] arguments: [ 15 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#confusing-naming - name: confusing-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#confusing-results - name: confusing-results severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#constant-logical-expr - name: constant-logical-expr severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#context-as-argument - name: context-as-argument severity: warning disabled: false exclude: [""] arguments: - allow-types-before: "*testing.T,*github.com/user/repo/testing.Harness" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#context-keys-type - name: context-keys-type severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#cyclomatic - name: cyclomatic severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#datarace - name: datarace severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#deep-exit - name: deep-exit severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#defer - name: defer severity: warning disabled: false exclude: [""] arguments: - "call-chain" - "loop" - "method-call" - "recover" - "immediate-recover" - "return" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#dot-imports - name: dot-imports severity: warning disabled: false exclude: [""] arguments: - allowed-packages: ["github.com/onsi/ginkgo/v2", "github.com/onsi/gomega"] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#duplicated-imports - name: duplicated-imports severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#early-return - name: early-return severity: warning disabled: false exclude: [""] arguments: - "preserve-scope" - "allow-jump" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#empty-block - name: empty-block severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#empty-lines - name: empty-lines severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-map-style - name: enforce-map-style severity: warning disabled: false exclude: [""] arguments: - "make" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-repeated-arg-type-style - name: enforce-repeated-arg-type-style severity: warning disabled: false exclude: [""] arguments: - "short" # Or this parameter: - func-arg-style: "full" func-ret-val-style: "short" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-slice-style - name: enforce-slice-style severity: warning disabled: false exclude: [""] arguments: - "make" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-switch-style - name: enforce-switch-style severity: warning disabled: false exclude: [""] arguments: [ "allowNoDefault" ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#epoch-naming - name: epoch-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#error-naming - name: error-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#error-return - name: error-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#error-strings - name: error-strings severity: warning disabled: false exclude: [""] arguments: - "xerrors.New" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#errorf - name: errorf severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#exported - name: exported severity: warning disabled: false exclude: [""] arguments: - "check-private-receivers" - "disable-stuttering-check" - "say-repetitive-instead-of-stutters" - "check-public-interface" - "disable-checks-on-constants" - "disable-checks-on-functions" - "disable-checks-on-methods" - "disable-checks-on-types" - "disable-checks-on-variables" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#file-header - name: file-header severity: warning disabled: false exclude: [""] arguments: - This is the text that must appear at the top of source files. # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#file-length-limit - name: file-length-limit severity: warning disabled: false exclude: [""] arguments: - max: 100 skip-comments: true skip-blank-lines: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#filename-format - name: filename-format severity: warning disabled: false exclude: [""] arguments: - "^[_a-z][_a-z0-9]*\\.go$" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#flag-parameter - name: flag-parameter severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#forbidden-call-in-wg-go - name: forbidden-call-in-wg-go severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#function-length - name: function-length severity: warning disabled: false exclude: [""] arguments: [ 10, 0 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#function-result-limit - name: function-result-limit severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#get-return - name: get-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-branches - name: identical-branches severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-branches - name: identical-ifelseif-branches severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-conditions - name: identical-ifelseif-conditions severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-branches - name: identical-switch-branches severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-conditions - name: identical-switch-conditions severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#if-return - name: if-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#import-alias-naming - name: import-alias-naming severity: warning disabled: false exclude: [""] arguments: - "^[a-z][a-z0-9]{0,}$" # Or this parameter: - allow-regex: "^[a-z][a-z0-9]{0,}$" deny-regex: '^v\d+$' # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#import-shadowing - name: import-shadowing severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#imports-blocklist - name: imports-blocklist severity: warning disabled: false exclude: [""] arguments: - "crypto/md5" - "crypto/sha1" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#increment-decrement - name: increment-decrement severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#indent-error-flow - name: indent-error-flow severity: warning disabled: false exclude: [""] arguments: - "preserve-scope" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#inefficient-map-lookup - name: inefficient-map-lookup severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#line-length-limit - name: line-length-limit severity: warning disabled: false exclude: [""] arguments: [ 80 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-control-nesting - name: max-control-nesting severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-public-structs - name: max-public-structs severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#modifies-parameter - name: modifies-parameter severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#modifies-value-receiver - name: modifies-value-receiver severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#nested-structs - name: nested-structs severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#optimize-operands-order - name: optimize-operands-order severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-comments - name: package-comments severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-directory-mismatch - name: package-directory-mismatch severity: warning disabled: false exclude: [""] arguments: - ignore-directories: ["testcases", "testinfo"] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-naming - name: package-naming severity: warning disabled: false exclude: [""] arguments: - skip-convention-name-check: true convention-name-check-regex: "^[a-z][a-zA-Z0-9]*$" skip-top-level-check: true skip-default-bad-name-check: true check-extra-bad-name: true user-defined-bad-names: - foo - bar skip-collision-with-common-std: true check-collision-with-all-std: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range - name: range severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range-val-address - name: range-val-address severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range-val-in-closure - name: range-val-in-closure severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#receiver-naming - name: receiver-naming severity: warning disabled: false exclude: [""] arguments: - max-length: 2 # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redefines-builtin-id - name: redefines-builtin-id severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-build-tag - name: redundant-build-tag severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-import-alias - name: redundant-import-alias severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-test-main-exit - name: redundant-test-main-exit severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#string-format - name: string-format severity: warning disabled: false exclude: [""] arguments: - - 'core.WriteError[1].Message' - '/^([^A-Z]|$)/' - must not start with a capital letter - - 'fmt.Errorf[0]' - '/(^|[^\.!?])$/' - must not end in punctuation - - panic - '/^[^\n]*$/' - must not contain line breaks # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#string-of-int - name: string-of-int severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#struct-tag - name: struct-tag severity: warning disabled: false exclude: [""] arguments: - "!validate" - "json,inline" - "bson,outline,gnu" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#superfluous-else - name: superfluous-else severity: warning disabled: false exclude: [""] arguments: - "preserve-scope" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-date - name: time-date severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-equal - name: time-equal severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-naming - name: time-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unchecked-type-assertion - name: unchecked-type-assertion severity: warning disabled: false exclude: [""] arguments: - accept-ignored-assertion-result: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unconditional-recursion - name: unconditional-recursion severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unexported-naming - name: unexported-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unexported-return - name: unexported-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unhandled-error - name: unhandled-error severity: warning disabled: false exclude: [""] arguments: - "^fmt.Printf" - "myFunction" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-format - name: unnecessary-format severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-if - name: unnecessary-if severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-stmt - name: unnecessary-stmt severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unreachable-code - name: unreachable-code severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-slices-sort - name: use-slices-sort severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unsecure-url-scheme - name: unsecure-url-scheme severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-parameter - name: unused-parameter severity: warning disabled: false exclude: [""] arguments: - allow-regex: "^_" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-receiver - name: unused-receiver severity: warning disabled: false exclude: [""] arguments: - allow-regex: "^_" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-any - name: use-any severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-errors-new - name: use-errors-new severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-fmt-print - name: use-fmt-print severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-slices-sort - name: use-slices-sort severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-waitgroup-go - name: use-waitgroup-go severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break - name: useless-break severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-fallthrough - name: useless-fallthrough severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#var-declaration - name: var-declaration severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#var-naming - name: var-naming severity: warning disabled: false exclude: [""] arguments: - [ "ID" ] # AllowList - [ "VM" ] # DenyList - - skip-initialism-name-checks: true upper-case-const: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#waitgroup-by-value - name: waitgroup-by-value severity: warning disabled: false exclude: [""] rowserrcheck: # database/sql is always checked. # Default: [] packages: - github.com/jmoiron/sqlx sloglint: # Enforce not mixing key-value pairs and attributes. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-mixed-arguments # Default: true no-mixed-args: false # Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only). # https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-value-pairs-only # Default: false kv-only: true # Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only). # https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only # Default: false attr-only: true # Enforce not using global loggers. # Values: # - "": disabled # - "all": report all global loggers # - "default": report only the default slog logger # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global # Default: "" no-global: "all" # Enforce using methods that accept a context. # Values: # - "": disabled # - "all": report all contextless calls # - "scope": report only if a context exists in the scope of the outermost function # https://github.com/go-simpler/sloglint?tab=readme-ov-file#context-only # Default: "" context: "all" # Enforce using static values for log messages. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#static-messages # Default: false static-msg: true # Enforce message style. # Values: lowercased, capitalized # https://github.com/go-simpler/sloglint?tab=readme-ov-file#message-style # Default: "" msg-style: capitalized # Enforce using constants instead of raw keys. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-raw-keys # Default: false no-raw-keys: true # Enforce key naming convention. # Values: snake, kebab, camel, pascal # https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-naming-convention # Default: "" key-naming-case: snake # Enforce not using specific keys. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys # Default: [] forbidden-keys: - time - level - msg - source - foo # Enforce putting arguments on separate lines. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#arguments-on-separate-lines # Default: false args-on-sep-lines: true spancheck: # Checks to enable. # Options include: # - `end`: check that `span.End()` is called # - `record-error`: check that `span.RecordError(err)` is called when an error is returned # - `set-status`: check that `span.SetStatus(codes.Error, msg)` is called when an error is returned # Default: ["end"] checks: - end - record-error - set-status # A list of regexes for function signatures that silence `record-error` and `set-status` reports # if found in the call path to a returned error. # https://github.com/jjti/go-spancheck#ignore-check-signatures # Default: [] ignore-check-signatures: - "telemetry.RecordError" # A list of regexes for additional function signatures that create spans. # This is useful if you have a utility method to create spans. # Each entry should be of the form `:`, where `telemetry-type` can be `opentelemetry` or `opencensus`. # https://github.com/jjti/go-spancheck#extra-start-span-signatures # Default: [] extra-start-span-signatures: - "github.com/user/repo/telemetry/trace.Start:opentelemetry" staticcheck: # https://staticcheck.dev/docs/configuration/options/#dot_import_whitelist # Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"] dot-import-whitelist: - fmt # https://staticcheck.dev/docs/configuration/options/#initialisms # Default: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"] initialisms: [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS" ] # https://staticcheck.dev/docs/configuration/options/#http_status_code_whitelist # Default: ["200", "400", "404", "500"] http-status-code-whitelist: [ "200", "400", "404", "500" ] # SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks # Example (to disable some checks): [ "all", "-SA1000", "-SA1001"] # Run `GL_DEBUG=staticcheck golangci-lint run --enable=staticcheck` to see all available checks and enabled by config checks. # Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"] checks: # Invalid regular expression. # https://staticcheck.dev/docs/checks/#SA1000 - SA1000 # Invalid template. # https://staticcheck.dev/docs/checks/#SA1001 - SA1001 # Invalid format in 'time.Parse'. # https://staticcheck.dev/docs/checks/#SA1002 - SA1002 # Unsupported argument to functions in 'encoding/binary'. # https://staticcheck.dev/docs/checks/#SA1003 - SA1003 # Suspiciously small untyped constant in 'time.Sleep'. # https://staticcheck.dev/docs/checks/#SA1004 - SA1004 # Invalid first argument to 'exec.Command'. # https://staticcheck.dev/docs/checks/#SA1005 - SA1005 # 'Printf' with dynamic first argument and no further arguments. # https://staticcheck.dev/docs/checks/#SA1006 - SA1006 # Invalid URL in 'net/url.Parse'. # https://staticcheck.dev/docs/checks/#SA1007 - SA1007 # Non-canonical key in 'http.Header' map. # https://staticcheck.dev/docs/checks/#SA1008 - SA1008 # '(*regexp.Regexp).FindAll' called with 'n == 0', which will always return zero results. # https://staticcheck.dev/docs/checks/#SA1010 - SA1010 # Various methods in the "strings" package expect valid UTF-8, but invalid input is provided. # https://staticcheck.dev/docs/checks/#SA1011 - SA1011 # A nil 'context.Context' is being passed to a function, consider using 'context.TODO' instead. # https://staticcheck.dev/docs/checks/#SA1012 - SA1012 # 'io.Seeker.Seek' is being called with the whence constant as the first argument, but it should be the second. # https://staticcheck.dev/docs/checks/#SA1013 - SA1013 # Non-pointer value passed to 'Unmarshal' or 'Decode'. # https://staticcheck.dev/docs/checks/#SA1014 - SA1014 # Using 'time.Tick' in a way that will leak. Consider using 'time.NewTicker', and only use 'time.Tick' in tests, commands and endless functions. # https://staticcheck.dev/docs/checks/#SA1015 - SA1015 # Trapping a signal that cannot be trapped. # https://staticcheck.dev/docs/checks/#SA1016 - SA1016 # Channels used with 'os/signal.Notify' should be buffered. # https://staticcheck.dev/docs/checks/#SA1017 - SA1017 # 'strings.Replace' called with 'n == 0', which does nothing. # https://staticcheck.dev/docs/checks/#SA1018 - SA1018 # Using a deprecated function, variable, constant or field. # https://staticcheck.dev/docs/checks/#SA1019 - SA1019 # Using an invalid host:port pair with a 'net.Listen'-related function. # https://staticcheck.dev/docs/checks/#SA1020 - SA1020 # Using 'bytes.Equal' to compare two 'net.IP'. # https://staticcheck.dev/docs/checks/#SA1021 - SA1021 # Modifying the buffer in an 'io.Writer' implementation. # https://staticcheck.dev/docs/checks/#SA1023 - SA1023 # A string cutset contains duplicate characters. # https://staticcheck.dev/docs/checks/#SA1024 - SA1024 # It is not possible to use '(*time.Timer).Reset''s return value correctly. # https://staticcheck.dev/docs/checks/#SA1025 - SA1025 # Cannot marshal channels or functions. # https://staticcheck.dev/docs/checks/#SA1026 - SA1026 # Atomic access to 64-bit variable must be 64-bit aligned. # https://staticcheck.dev/docs/checks/#SA1027 - SA1027 # 'sort.Slice' can only be used on slices. # https://staticcheck.dev/docs/checks/#SA1028 - SA1028 # Inappropriate key in call to 'context.WithValue'. # https://staticcheck.dev/docs/checks/#SA1029 - SA1029 # Invalid argument in call to a 'strconv' function. # https://staticcheck.dev/docs/checks/#SA1030 - SA1030 # Overlapping byte slices passed to an encoder. # https://staticcheck.dev/docs/checks/#SA1031 - SA1031 # Wrong order of arguments to 'errors.Is'. # https://staticcheck.dev/docs/checks/#SA1032 - SA1032 # 'sync.WaitGroup.Add' called inside the goroutine, leading to a race condition. # https://staticcheck.dev/docs/checks/#SA2000 - SA2000 # Empty critical section, did you mean to defer the unlock?. # https://staticcheck.dev/docs/checks/#SA2001 - SA2001 # Called 'testing.T.FailNow' or 'SkipNow' in a goroutine, which isn't allowed. # https://staticcheck.dev/docs/checks/#SA2002 - SA2002 # Deferred 'Lock' right after locking, likely meant to defer 'Unlock' instead. # https://staticcheck.dev/docs/checks/#SA2003 - SA2003 # 'TestMain' doesn't call 'os.Exit', hiding test failures. # https://staticcheck.dev/docs/checks/#SA3000 - SA3000 # Assigning to 'b.N' in benchmarks distorts the results. # https://staticcheck.dev/docs/checks/#SA3001 - SA3001 # Binary operator has identical expressions on both sides. # https://staticcheck.dev/docs/checks/#SA4000 - SA4000 # '&*x' gets simplified to 'x', it does not copy 'x'. # https://staticcheck.dev/docs/checks/#SA4001 - SA4001 # Comparing unsigned values against negative values is pointless. # https://staticcheck.dev/docs/checks/#SA4003 - SA4003 # The loop exits unconditionally after one iteration. # https://staticcheck.dev/docs/checks/#SA4004 - SA4004 # Field assignment that will never be observed. Did you mean to use a pointer receiver?. # https://staticcheck.dev/docs/checks/#SA4005 - SA4005 # A value assigned to a variable is never read before being overwritten. Forgotten error check or dead code?. # https://staticcheck.dev/docs/checks/#SA4006 - SA4006 # The variable in the loop condition never changes, are you incrementing the wrong variable?. # https://staticcheck.dev/docs/checks/#SA4008 - SA4008 # A function argument is overwritten before its first use. # https://staticcheck.dev/docs/checks/#SA4009 - SA4009 # The result of 'append' will never be observed anywhere. # https://staticcheck.dev/docs/checks/#SA4010 - SA4010 # Break statement with no effect. Did you mean to break out of an outer loop?. # https://staticcheck.dev/docs/checks/#SA4011 - SA4011 # Comparing a value against NaN even though no value is equal to NaN. # https://staticcheck.dev/docs/checks/#SA4012 - SA4012 # Negating a boolean twice ('!!b') is the same as writing 'b'. This is either redundant, or a typo. # https://staticcheck.dev/docs/checks/#SA4013 - SA4013 # An if/else if chain has repeated conditions and no side-effects; if the condition didn't match the first time, it won't match the second time, either. # https://staticcheck.dev/docs/checks/#SA4014 - SA4014 # Calling functions like 'math.Ceil' on floats converted from integers doesn't do anything useful. # https://staticcheck.dev/docs/checks/#SA4015 - SA4015 # Certain bitwise operations, such as 'x ^ 0', do not do anything useful. # https://staticcheck.dev/docs/checks/#SA4016 - SA4016 # Discarding the return values of a function without side effects, making the call pointless. # https://staticcheck.dev/docs/checks/#SA4017 - SA4017 # Self-assignment of variables. # https://staticcheck.dev/docs/checks/#SA4018 - SA4018 # Multiple, identical build constraints in the same file. # https://staticcheck.dev/docs/checks/#SA4019 - SA4019 # Unreachable case clause in a type switch. # https://staticcheck.dev/docs/checks/#SA4020 - SA4020 # "x = append(y)" is equivalent to "x = y". # https://staticcheck.dev/docs/checks/#SA4021 - SA4021 # Comparing the address of a variable against nil. # https://staticcheck.dev/docs/checks/#SA4022 - SA4022 # Impossible comparison of interface value with untyped nil. # https://staticcheck.dev/docs/checks/#SA4023 - SA4023 # Checking for impossible return value from a builtin function. # https://staticcheck.dev/docs/checks/#SA4024 - SA4024 # Integer division of literals that results in zero. # https://staticcheck.dev/docs/checks/#SA4025 - SA4025 # Go constants cannot express negative zero. # https://staticcheck.dev/docs/checks/#SA4026 - SA4026 # '(*net/url.URL).Query' returns a copy, modifying it doesn't change the URL. # https://staticcheck.dev/docs/checks/#SA4027 - SA4027 # 'x % 1' is always zero. # https://staticcheck.dev/docs/checks/#SA4028 - SA4028 # Ineffective attempt at sorting slice. # https://staticcheck.dev/docs/checks/#SA4029 - SA4029 # Ineffective attempt at generating random number. # https://staticcheck.dev/docs/checks/#SA4030 - SA4030 # Checking never-nil value against nil. # https://staticcheck.dev/docs/checks/#SA4031 - SA4031 # Comparing 'runtime.GOOS' or 'runtime.GOARCH' against impossible value. # https://staticcheck.dev/docs/checks/#SA4032 - SA4032 # Assignment to nil map. # https://staticcheck.dev/docs/checks/#SA5000 - SA5000 # Deferring 'Close' before checking for a possible error. # https://staticcheck.dev/docs/checks/#SA5001 - SA5001 # The empty for loop ("for {}") spins and can block the scheduler. # https://staticcheck.dev/docs/checks/#SA5002 - SA5002 # Defers in infinite loops will never execute. # https://staticcheck.dev/docs/checks/#SA5003 - SA5003 # "for { select { ..." with an empty default branch spins. # https://staticcheck.dev/docs/checks/#SA5004 - SA5004 # The finalizer references the finalized object, preventing garbage collection. # https://staticcheck.dev/docs/checks/#SA5005 - SA5005 # Infinite recursive call. # https://staticcheck.dev/docs/checks/#SA5007 - SA5007 # Invalid struct tag. # https://staticcheck.dev/docs/checks/#SA5008 - SA5008 # Invalid Printf call. # https://staticcheck.dev/docs/checks/#SA5009 - SA5009 # Impossible type assertion. # https://staticcheck.dev/docs/checks/#SA5010 - SA5010 # Possible nil pointer dereference. # https://staticcheck.dev/docs/checks/#SA5011 - SA5011 # Passing odd-sized slice to function expecting even size. # https://staticcheck.dev/docs/checks/#SA5012 - SA5012 # Using 'regexp.Match' or related in a loop, should use 'regexp.Compile'. # https://staticcheck.dev/docs/checks/#SA6000 - SA6000 # Missing an optimization opportunity when indexing maps by byte slices. # https://staticcheck.dev/docs/checks/#SA6001 - SA6001 # Storing non-pointer values in 'sync.Pool' allocates memory. # https://staticcheck.dev/docs/checks/#SA6002 - SA6002 # Converting a string to a slice of runes before ranging over it. # https://staticcheck.dev/docs/checks/#SA6003 - SA6003 # Inefficient string comparison with 'strings.ToLower' or 'strings.ToUpper'. # https://staticcheck.dev/docs/checks/#SA6005 - SA6005 # Using io.WriteString to write '[]byte'. # https://staticcheck.dev/docs/checks/#SA6006 - SA6006 # Defers in range loops may not run when you expect them to. # https://staticcheck.dev/docs/checks/#SA9001 - SA9001 # Using a non-octal 'os.FileMode' that looks like it was meant to be in octal. # https://staticcheck.dev/docs/checks/#SA9002 - SA9002 # Empty body in an if or else branch. # https://staticcheck.dev/docs/checks/#SA9003 - SA9003 # Only the first constant has an explicit type. # https://staticcheck.dev/docs/checks/#SA9004 - SA9004 # Trying to marshal a struct with no public fields nor custom marshaling. # https://staticcheck.dev/docs/checks/#SA9005 - SA9005 # Dubious bit shifting of a fixed size integer value. # https://staticcheck.dev/docs/checks/#SA9006 - SA9006 # Deleting a directory that shouldn't be deleted. # https://staticcheck.dev/docs/checks/#SA9007 - SA9007 # 'else' branch of a type assertion is probably not reading the right value. # https://staticcheck.dev/docs/checks/#SA9008 - SA9008 # Ineffectual Go compiler directive. # https://staticcheck.dev/docs/checks/#SA9009 - SA9009 # Incorrect or missing package comment. # https://staticcheck.dev/docs/checks/#ST1000 - ST1000 # Dot imports are discouraged. # https://staticcheck.dev/docs/checks/#ST1001 - ST1001 # Poorly chosen identifier. # https://staticcheck.dev/docs/checks/#ST1003 - ST1003 # Incorrectly formatted error string. # https://staticcheck.dev/docs/checks/#ST1005 - ST1005 # Poorly chosen receiver name. # https://staticcheck.dev/docs/checks/#ST1006 - ST1006 # A function's error value should be its last return value. # https://staticcheck.dev/docs/checks/#ST1008 - ST1008 # Poorly chosen name for variable of type 'time.Duration'. # https://staticcheck.dev/docs/checks/#ST1011 - ST1011 # Poorly chosen name for error variable. # https://staticcheck.dev/docs/checks/#ST1012 - ST1012 # Should use constants for HTTP error codes, not magic numbers. # https://staticcheck.dev/docs/checks/#ST1013 - ST1013 # A switch's default case should be the first or last case. # https://staticcheck.dev/docs/checks/#ST1015 - ST1015 # Use consistent method receiver names. # https://staticcheck.dev/docs/checks/#ST1016 - ST1016 # Don't use Yoda conditions. # https://staticcheck.dev/docs/checks/#ST1017 - ST1017 # Avoid zero-width and control characters in string literals. # https://staticcheck.dev/docs/checks/#ST1018 - ST1018 # Importing the same package multiple times. # https://staticcheck.dev/docs/checks/#ST1019 - ST1019 # The documentation of an exported function should start with the function's name. # https://staticcheck.dev/docs/checks/#ST1020 - ST1020 # The documentation of an exported type should start with type's name. # https://staticcheck.dev/docs/checks/#ST1021 - ST1021 # The documentation of an exported variable or constant should start with variable's name. # https://staticcheck.dev/docs/checks/#ST1022 - ST1022 # Redundant type in variable declaration. # https://staticcheck.dev/docs/checks/#ST1023 - ST1023 # Use plain channel send or receive instead of single-case select. # https://staticcheck.dev/docs/checks/#S1000 - S1000 # Replace for loop with call to copy. # https://staticcheck.dev/docs/checks/#S1001 - S1001 # Omit comparison with boolean constant. # https://staticcheck.dev/docs/checks/#S1002 - S1002 # Replace call to 'strings.Index' with 'strings.Contains'. # https://staticcheck.dev/docs/checks/#S1003 - S1003 # Replace call to 'bytes.Compare' with 'bytes.Equal'. # https://staticcheck.dev/docs/checks/#S1004 - S1004 # Drop unnecessary use of the blank identifier. # https://staticcheck.dev/docs/checks/#S1005 - S1005 # Use "for { ... }" for infinite loops. # https://staticcheck.dev/docs/checks/#S1006 - S1006 # Simplify regular expression by using raw string literal. # https://staticcheck.dev/docs/checks/#S1007 - S1007 # Simplify returning boolean expression. # https://staticcheck.dev/docs/checks/#S1008 - S1008 # Omit redundant nil check on slices, maps, and channels. # https://staticcheck.dev/docs/checks/#S1009 - S1009 # Omit default slice index. # https://staticcheck.dev/docs/checks/#S1010 - S1010 # Use a single 'append' to concatenate two slices. # https://staticcheck.dev/docs/checks/#S1011 - S1011 # Replace 'time.Now().Sub(x)' with 'time.Since(x)'. # https://staticcheck.dev/docs/checks/#S1012 - S1012 # Use a type conversion instead of manually copying struct fields. # https://staticcheck.dev/docs/checks/#S1016 - S1016 # Replace manual trimming with 'strings.TrimPrefix'. # https://staticcheck.dev/docs/checks/#S1017 - S1017 # Use "copy" for sliding elements. # https://staticcheck.dev/docs/checks/#S1018 - S1018 # Simplify "make" call by omitting redundant arguments. # https://staticcheck.dev/docs/checks/#S1019 - S1019 # Omit redundant nil check in type assertion. # https://staticcheck.dev/docs/checks/#S1020 - S1020 # Merge variable declaration and assignment. # https://staticcheck.dev/docs/checks/#S1021 - S1021 # Omit redundant control flow. # https://staticcheck.dev/docs/checks/#S1023 - S1023 # Replace 'x.Sub(time.Now())' with 'time.Until(x)'. # https://staticcheck.dev/docs/checks/#S1024 - S1024 # Don't use 'fmt.Sprintf("%s", x)' unnecessarily. # https://staticcheck.dev/docs/checks/#S1025 - S1025 # Simplify error construction with 'fmt.Errorf'. # https://staticcheck.dev/docs/checks/#S1028 - S1028 # Range over the string directly. # https://staticcheck.dev/docs/checks/#S1029 - S1029 # Use 'bytes.Buffer.String' or 'bytes.Buffer.Bytes'. # https://staticcheck.dev/docs/checks/#S1030 - S1030 # Omit redundant nil check around loop. # https://staticcheck.dev/docs/checks/#S1031 - S1031 # Use 'sort.Ints(x)', 'sort.Float64s(x)', and 'sort.Strings(x)'. # https://staticcheck.dev/docs/checks/#S1032 - S1032 # Unnecessary guard around call to "delete". # https://staticcheck.dev/docs/checks/#S1033 - S1033 # Use result of type assertion to simplify cases. # https://staticcheck.dev/docs/checks/#S1034 - S1034 # Redundant call to 'net/http.CanonicalHeaderKey' in method call on 'net/http.Header'. # https://staticcheck.dev/docs/checks/#S1035 - S1035 # Unnecessary guard around map access. # https://staticcheck.dev/docs/checks/#S1036 - S1036 # Elaborate way of sleeping. # https://staticcheck.dev/docs/checks/#S1037 - S1037 # Unnecessarily complex way of printing formatted string. # https://staticcheck.dev/docs/checks/#S1038 - S1038 # Unnecessary use of 'fmt.Sprint'. # https://staticcheck.dev/docs/checks/#S1039 - S1039 # Type assertion to current type. # https://staticcheck.dev/docs/checks/#S1040 - S1040 # Apply De Morgan's law. # https://staticcheck.dev/docs/checks/#QF1001 - QF1001 # Convert untagged switch to tagged switch. # https://staticcheck.dev/docs/checks/#QF1002 - QF1002 # Convert if/else-if chain to tagged switch. # https://staticcheck.dev/docs/checks/#QF1003 - QF1003 # Use 'strings.ReplaceAll' instead of 'strings.Replace' with 'n == -1'. # https://staticcheck.dev/docs/checks/#QF1004 - QF1004 # Expand call to 'math.Pow'. # https://staticcheck.dev/docs/checks/#QF1005 - QF1005 # Lift 'if'+'break' into loop condition. # https://staticcheck.dev/docs/checks/#QF1006 - QF1006 # Merge conditional assignment into variable declaration. # https://staticcheck.dev/docs/checks/#QF1007 - QF1007 # Omit embedded fields from selector expression. # https://staticcheck.dev/docs/checks/#QF1008 - QF1008 # Use 'time.Time.Equal' instead of '==' operator. # https://staticcheck.dev/docs/checks/#QF1009 - QF1009 # Convert slice of bytes to string when printing it. # https://staticcheck.dev/docs/checks/#QF1010 - QF1010 # Omit redundant type from variable declaration. # https://staticcheck.dev/docs/checks/#QF1011 - QF1011 # Use 'fmt.Fprintf(x, ...)' instead of 'x.Write(fmt.Sprintf(...))'. # https://staticcheck.dev/docs/checks/#QF1012 - QF1012 tagalign: # Align and sort can be used together or separately. # # Whether enable align. If true, the struct tags will be aligned. # E.g.: # type FooBar struct { # Bar string `json:"bar" validate:"required"` # FooFoo int8 `json:"foo_foo" validate:"required"` # } # will be formatted to: # type FooBar struct { # Bar string `json:"bar" validate:"required"` # FooFoo int8 `json:"foo_foo" validate:"required"` # } # Default: true. align: false # Whether enable tags sort. # If true, the tags will be sorted by name in ascending order. # E.g.: `xml:"bar" json:"bar" validate:"required"` -> `json:"bar" validate:"required" xml:"bar"`. # Default: true sort: false # Specify the order of tags, the other tags will be sorted by name. # This option will be ignored if `sort` is false. # Default: [] order: - json - yaml - yml - toml - mapstructure - binding - validate # Whether enable strict style. # In this style, the tags will be sorted and aligned in the dictionary order, # and the tags with the same name will be aligned together. # Note: This option will be ignored if 'align' or 'sort' is false. # Default: false strict: true tagliatelle: # Checks the struct tag name case. case: # Defines the association between tag name and case. # Any struct tag name can be used. # Supported string cases: # - `camel` # - `pascal` # - `kebab` # - `snake` # - `upperSnake` # - `goCamel` # - `goPascal` # - `goKebab` # - `goSnake` # - `upper` # - `lower` # - `header` rules: json: camel yaml: camel xml: camel toml: camel bson: camel avro: snake mapstructure: kebab env: upperSnake envconfig: upperSnake whatever: snake # Defines the association between tag name and case. # Important: the `extended-rules` overrides `rules`. # Default: empty extended-rules: json: # Supported string cases: # - `camel` # - `pascal` # - `kebab` # - `snake` # - `upperSnake` # - `goCamel` # - `goPascal` # - `goKebab` # - `goSnake` # - `header` # - `lower` # - `header` # # Required case: camel # Adds 'AMQP', 'DB', 'GID', 'RTP', 'SIP', 'TS' to initialisms, # and removes 'LHS', 'RHS' from initialisms. # Default: false extra-initialisms: true # Defines initialism additions and overrides. # Default: empty initialism-overrides: DB: true # add a new initialism LHS: false # disable a default initialism. # ... # Uses the struct field name to check the name of the struct tag. # Default: false use-field-name: true # The field names to ignore. # Default: [] ignored-fields: - Bar - Foo # Overrides the default/root configuration. # Default: [] overrides: - # The package path (uses `/` only as a separator). # Required pkg: foo/bar # Default: empty or the same as the default/root configuration. rules: json: snake xml: pascal # Default: empty or the same as the default/root configuration. extended-rules: # Same options as the base `extended-rules`. # Default: false (WARNING: it doesn't follow the default/root configuration) use-field-name: true # The field names to ignore. # Default: [] or the same as the default/root configuration. ignored-fields: - Bar - Foo # Ignore the package (takes precedence over all other configurations). # Default: false ignore: true testifylint: # Enable all checkers (https://github.com/Antonboom/testifylint#checkers). # Default: false enable-all: true # Disable checkers by name # (in addition to default # suite-thelper # ). disable: - blank-import - bool-compare - compares - contains - empty - encoded-compare - equal-values - error-is-as - error-nil - expected-actual - float-compare - formatter - go-require - len - negative-positive - nil-compare - regexp - require-error - suite-broken-parallel - suite-dont-use-pkg - suite-extra-assert-call - suite-method-signature - suite-subtest-run - suite-thelper - useless-assert # Disable all checkers (https://github.com/Antonboom/testifylint#checkers). # Default: false disable-all: true # Enable checkers by name # (in addition to default # blank-import, bool-compare, compares, contains, empty, encoded-compare, equal-values, error-is-as, error-nil, # expected-actual, go-require, float-compare, formatter, len, negative-positive, nil-compare, regexp, require-error, # suite-broken-parallel, suite-dont-use-pkg, suite-extra-assert-call, suite-subtest-run, suite-method-signature, # useless-assert # ). enable: - blank-import - bool-compare - compares - contains - empty - encoded-compare - equal-values - error-is-as - error-nil - expected-actual - float-compare - formatter - go-require - len - negative-positive - nil-compare - regexp - require-error - suite-broken-parallel - suite-dont-use-pkg - suite-extra-assert-call - suite-method-signature - suite-subtest-run - suite-thelper - useless-assert bool-compare: # To ignore user defined types (over builtin bool). # Default: false ignore-custom-types: true expected-actual: # Regexp for expected variable name. # Default: (^(exp(ected)?|want(ed)?)([A-Z]\w*)?$)|(^(\w*[a-z])?(Exp(ected)?|Want(ed)?)$) pattern: ^expected formatter: # To enable go vet's printf checks. # Default: true check-format-string: false # To require f-assertions (e.g. `assert.Equalf`) if format string is used, even if there are no variable-length # variables, i.e. it requires `require.NoErrorf` for both these cases: # - require.NoErrorf(t, err, "unexpected error") # - require.NoErrorf(t, err, "unexpected error for sid: %v", sid) # To understand this behavior, please read the # https://github.com/Antonboom/testifylint?tab=readme-ov-file#historical-reference-of-formatter. # Default: false require-f-funcs: true # To require that the first element of msgAndArgs (msg) has a string type. # For example, in such case assertion like `assert.True(t, b, tt.case)` will be considered as invalid. # Default: true require-string-msg: false go-require: # To ignore HTTP handlers (like http.HandlerFunc). # Default: false ignore-http-handlers: true require-error: # Regexp for assertions to analyze. If defined, then only matched error assertions will be reported. # Default: "" fn-pattern: ^(Errorf?|NoErrorf?)$ suite-extra-assert-call: # To require or remove extra Assert() call? # Default: remove mode: require testpackage: # Regexp pattern to skip files. # Default: "(export|internal)_test\\.go" skip-regexp: (export|internal)_test\.go # List of packages that don't end with _test that tests are allowed to be in. # Default: "main" allow-packages: - example - main thelper: test: # Check *testing.T is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.T param has name t. # Default: true name: false # Check t.Helper() begins helper function. # Default: true begin: false benchmark: # Check *testing.B is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.B param has name b. # Default: true name: false # Check b.Helper() begins helper function. # Default: true begin: false tb: # Check *testing.TB is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.TB param has name tb. # Default: true name: false # Check tb.Helper() begins helper function. # Default: true begin: false fuzz: # Check *testing.F is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.F param has name f. # Default: true name: false # Check f.Helper() begins helper function. # Default: true begin: false usestdlibvars: # Suggest the use of http.MethodXX. # Default: true http-method: false # Suggest the use of http.StatusXX. # Default: true http-status-code: false # Suggest the use of time.Month in time.Date. # Default: false time-date-month: true # Suggest the use of time.Weekday.String(). # Default: true time-weekday: true # Suggest the use of time.Month.String(). # Default: false time-month: true # Suggest the use of time.Layout. # Default: false time-layout: true # Suggest the use of crypto.Hash.String(). # Default: false crypto-hash: true # Suggest the use of rpc.DefaultXXPath. # Default: false default-rpc-path: true # Suggest the use of sql.LevelXX.String(). # Default: false sql-isolation-level: true # Suggest the use of tls.SignatureScheme.String(). # Default: false tls-signature-scheme: true # Suggest the use of constant.Kind.String(). # Default: false constant-kind: true usetesting: # Enable/disable `os.CreateTemp("", ...)` detections. # Default: true os-create-temp: false # Enable/disable `os.MkdirTemp()` detections. # Default: true os-mkdir-temp: false # Enable/disable `os.Setenv()` detections. # Default: true os-setenv: false # Enable/disable `os.TempDir()` detections. # Default: false os-temp-dir: true # Enable/disable `os.Chdir()` detections. # Disabled if Go < 1.24. # Default: true os-chdir: false # Enable/disable `context.Background()` detections. # Disabled if Go < 1.24. # Default: false context-background: true # Enable/disable `context.TODO()` detections. # Disabled if Go < 1.24. # Default: false context-todo: true unconvert: # Remove conversions that force intermediate rounding. # Default: false fast-math: true # Be more conservative (experimental). # Default: false safe: true unparam: # Inspect exported functions. # Set to true if no external program/library imports your code. # # IMPORTANT: If you enable this setting, unparam reports many false positives in text editors: # when run on a subdirectory it cannot find external interfaces. # Most editor integrations invoke golangci-lint on the directory containing the changed file. # # Default: false check-exported: true unqueryvet: # Enable SQL builder checking. # Default: true check-sql-builders: false # Enable aliased wildcard detection like `SELECT t.*`. # Default: true check-aliased-wildcard: false # Enable string concatenation analysis. # Default: true check-string-concat: false # Enable format string analysis like `fmt.Sprintf`. # Default: true check-format-strings: false # Enable strings.Builder analysis. # Default: true check-string-builder: false # Enable subquery analysis. # Default: true check-subqueries: false # Detects N+1 Query. # Default: false check-n1: true # Detects SQL injection. # Default: false check-sql-injection: true # Detects transaction leaks. # Default: false check-tx-leaks: true # Regex patterns for acceptable `SELECT *` usage. # Default: # - "SELECT \\* FROM information_schema\\..*" # - "SELECT \\* FROM pg_catalog\\..*" # - "SELECT COUNT\\(\\*\\)" # - "SELECT MAX\\(\\*\\)" # - "SELECT MIN\\(\\*\\)" allowed-patterns: - "SELECT \\* FROM temp_.*" - "SELECT \\* FROM.*-- migration" # Allow is a list of SQL patterns to allow (whitelist). # Default: [] allow: - foo # Functions to ignore (regex patterns) # Default: [] ignored-functions: - "debug\\..*" - "test.*" # SQL builder libraries to check. # Default: all true. sql-builders: squirrel: false gorm: false sqlx: false ent: false pgx: false bun: false sqlboiler: false jet: false # List of user-defined DSL rules. # https://github.com/MirrexOne/unqueryvet?tab=readme-ov-file#custom-rules-dsl # Default: [] custom-rules: - id: allow-temp-tables pattern: "SELECT * FROM $TABLE" when: "isTempTable(table)" action: allow - id: dangerous-delete pattern: "DELETE FROM $TABLE" when: "!has_where" message: "DELETE without WHERE clause" unused: # Mark all struct fields that have been written to as used. # Default: true field-writes-are-uses: false # Treat IncDec statement (e.g. `i++` or `i--`) as both read and write operation instead of just write. # Default: false post-statements-are-reads: true # Mark all exported fields as used. # default: true exported-fields-are-used: false # Mark all function parameters as used. # default: true parameters-are-used: false # Mark all local variables as used. # default: true local-variables-are-used: false # Mark all identifiers inside generated files as used. # Default: true generated-is-used: false varnamelen: # The longest distance, in source lines, that is being considered a "small scope". # Variables used in at most this many lines will be ignored. # Default: 5 max-distance: 6 # The minimum length of a variable's name that is considered "long". # Variable names that are at least this long will be ignored. # Default: 3 min-name-length: 2 # Check method receivers. # Default: false check-receiver: true # Check named return values. # Default: false check-return: true # Check type parameters. # Default: false check-type-param: true # Ignore "ok" variables that hold the bool return value of a type assertion. # Default: false ignore-type-assert-ok: true # Ignore "ok" variables that hold the bool return value of a map index. # Default: false ignore-map-index-ok: true # Ignore "ok" variables that hold the bool return value of a channel receive. # Default: false ignore-chan-recv-ok: true # Optional list of variable names that should be ignored completely. # Default: [] ignore-names: - err # Optional list of variable declarations that should be ignored completely. # Entries must be in one of the following forms (see below for examples): # - for variables, parameters, named return values, method receivers, or type parameters: # ( can also be a pointer/slice/map/chan/...) # - for constants: const # # Default: [] ignore-decls: - c echo.Context - t testing.T - f *foo.Bar - e error - i int - const C - T any - m map[string]int whitespace: # Enforces newlines (or comments) after every multi-line if statement. # Default: false multi-if: true # Enforces newlines (or comments) after every multi-line function signature. # Default: false multi-func: true wrapcheck: # An array of strings specifying additional substrings of signatures to ignore. # Unlike 'ignore-sigs', this option extends the default set (or the set specified in 'ignore-sigs') without replacing it entirely. # This allows you to add specific signatures to the ignore list # while retaining the defaults or any items in 'ignore-sigs'. # Default: [] extra-ignore-sigs: - .CustomError( - .SpecificWrap( # An array of strings that specify substrings of signatures to ignore. # If this set, it will override the default set of ignored signatures. # See https://github.com/tomarrell/wrapcheck#configuration for more information. # Default: [".Errorf(", "errors.New(", "errors.Unwrap(", "errors.Join(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("] ignore-sigs: - .Errorf( - errors.New( - errors.Unwrap( - errors.Join( - .Wrap( - .Wrapf( - .WithMessage( - .WithMessagef( - .WithStack( # An array of strings that specify regular expressions of signatures to ignore. # Default: [] ignore-sig-regexps: - \.New.*Error\( # An array of strings that specify globs of packages to ignore. # Default: [] ignore-package-globs: - encoding/* - github.com/pkg/* # An array of strings that specify regular expressions of interfaces to ignore. # Default: [] ignore-interface-regexps: - ^(?i)c(?-i)ach(ing|e) # Determines whether wrapcheck should report errors returned from inside the package. # Default: false report-internal-errors: true wsl: # Do strict checking when assigning from append (x = append(x, y)). # If this is set to true - the append call must append either a variable # assigned, called or used on the line above. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#strict-append # Default: true strict-append: false # Allows assignments to be cuddled with variables used in calls on # line above and calls to be cuddled with assignments of variables # used in call on line above. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-assign-and-call # Default: true allow-assign-and-call: false # Allows assignments to be cuddled with anything. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-assign-and-anything # Default: false allow-assign-and-anything: true # Allows cuddling to assignments even if they span over multiple lines. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-multiline-assign # Default: true allow-multiline-assign: false # If the number of lines in a case block is equal to or lager than this number, # the case *must* end white a newline. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#force-case-trailing-whitespace # Default: 0 force-case-trailing-whitespace: 1 # Allow blocks to end with comments. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-trailing-comment # Default: false allow-trailing-comment: true # Allow multiple comments in the beginning of a block separated with newline. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-separated-leading-comment # Default: false allow-separated-leading-comment: true # Allow multiple var/declaration statements to be cuddled. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-cuddle-declarations # Default: false allow-cuddle-declarations: true # A list of call idents that everything can be cuddled with. # Defaults: [ "Lock", "RLock" ] allow-cuddle-with-calls: [ "Foo", "Bar" ] # AllowCuddleWithRHS is a list of right hand side variables that is allowed # to be cuddled with anything. # Defaults: [ "Unlock", "RUnlock" ] allow-cuddle-with-rhs: [ "Foo", "Bar" ] # Allow cuddling with any block as long as the variable is used somewhere in # the block. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-cuddle-used-in-block # Default: false allow-cuddle-used-in-block: true # Causes an error when an If statement that checks an error variable doesn't # cuddle with the assignment of that variable. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#force-err-cuddling # Default: false force-err-cuddling: true # When force-err-cuddling is enabled this is a list of names # used for error variables to check for in the conditional. # Default: [ "err" ] error-variable-names: [ "foo" ] # Causes an error if a short declaration (:=) cuddles with anything other than # another short declaration. # This logic overrides force-err-cuddling among others. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#force-short-decl-cuddling # Default: false force-short-decl-cuddling: true wsl_v5: # Allow cuddling a variable if it's used first in the immediate following block, # even if the statement with the block doesn't use the variable. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: true allow-first-in-block: false # Same as above, # but allows cuddling if the variable is used anywhere in the following (or nested) block. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: false allow-whole-block: true # If a block contains more than this number of lines, # the branch statement needs to be separated by whitespace. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: 2 branch-max-lines: 4 # If set to a non-negative number, # case blocks need to end with whitespace if exceeding this number # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: 0 case-max-lines: 2 # Default checks to use. # Can be `all`, `none`, `default` or empty. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration # Default: "" default: all # Enabled checks. # Will be additive to any presets. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration # Default: [] enable: - assign - branch - decl - defer - expr - for - go - if - inc-dec - label - range - return - select - send - switch - type-switch - append - assign-exclusive - assign-expr - err - leading-whitespace - trailing-whitespace - after-block # Disable checks. # Will be subtractive to any preset. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration # Default: [] disable: - assign - branch - decl - defer - expr - for - go - if - inc-dec - label - range - return - select - send - switch - type-switch - append - assign-exclusive - assign-expr - err - leading-whitespace - trailing-whitespace - after-block # The custom section can be used to define linter plugins to be loaded at runtime. # See README documentation for more info. custom: # Each custom linter should have a unique name. example: # The plugin type. # It can be `goplugin` or `module`. # Default: goplugin type: module # The path to the plugin *.so. Can be absolute or local. # Required for each custom linter. path: /path/to/example.so # The description of the linter. # Optional. description: This is an example usage of a plugin linter. # Intended to point to the repo location of the linter. # Optional. original-url: github.com/golangci/example-linter # Plugins settings/configuration. # Only work with plugin based on `linterdb.PluginConstructor`. # Optional. settings: foo: bar # Defines a set of rules to ignore issues. # It does not skip the analysis, and so does not ignore "typecheck" errors. exclusions: # Mode of the generated files analysis. # # - `strict`: sources are excluded by strictly following the Go generated file convention. # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$` # This line must appear before the first non-comment, non-blank text in the file. # https://go.dev/s/generatedcode # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc. # - `disable`: disable the generated files exclusion. # # Default: strict generated: lax # Log a warning if an exclusion rule is unused. # Default: false warn-unused: true # Predefined exclusion rules. # Default: [] presets: - comments - std-error-handling - common-false-positives - legacy # Excluding configuration per-path, per-linter, per-text and per-source. rules: # Exclude some linters from running on tests files. - path: _test\.go linters: - gocyclo - errcheck - dupl - gosec # Run some linter only for test files by excluding its issues for everything else. - path-except: _test\.go linters: - forbidigo # Exclude known linters from partially hard-vendored code, # which is impossible to exclude via `nolint` comments. # `/` will be replaced by the current OS file path separator to properly work on Windows. - path: internal/hmac/ text: "weak cryptographic primitive" linters: - gosec # Exclude some `staticcheck` messages. - linters: - staticcheck text: "SA9003:" # Exclude `lll` issues for long lines with `go:generate`. - linters: - lll source: "^//go:generate " # Which file paths to exclude: they will be analyzed, but issues from them won't be reported. # "/" will be replaced by the current OS file path separator to properly work on Windows. # Default: [] paths: - ".*\\.my\\.go$" - lib/bad.go # Which file paths to not exclude. # Default: [] paths-except: - ".*\\.my\\.go$" - lib/bad.go formatters: # Enable specific formatter. # Default: [] (uses standard Go formatting) enable: - gci - gofmt - gofumpt - goimports - golines - swaggo # Formatters settings. settings: gci: # Section configuration to compare against. # Section names are case-insensitive and may contain parameters in (). # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`. # If `custom-order` is `true`, it follows the order of `sections` option. # Default: ["standard", "default"] sections: - standard # Standard section: captures all standard packages. - default # Default section: contains all imports that could not be matched to another section type. - prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix. - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled. - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled. # Checks that no inline comments are present. # Default: false no-inline-comments: true # Checks that no prefix comments (comment lines above an import) are present. # Default: false no-prefix-comments: true # Enable custom order of sections. # If `true`, make the section order the same as the order of `sections`. # Default: false custom-order: true # Drops lexical ordering for custom sections. # Default: false no-lex-order: true gofmt: # Simplify code: gofmt with `-s` option. # Default: true simplify: false # Apply the rewrite rules to the source before reformatting. # https://pkg.go.dev/cmd/gofmt # Default: [] rewrite-rules: - pattern: 'interface{}' replacement: 'any' - pattern: 'a[b:len(a)]' replacement: 'a[b:]' gofumpt: # Module path which contains the source code being formatted. # Default: "" module-path: github.com/org/project # Choose whether to use the extra rules. # Default: false extra-rules: true goimports: # A list of prefixes, which, if set, checks import paths # with the given prefixes are grouped after 3rd-party packages. # Default: [] local-prefixes: - github.com/org/project golines: # Target maximum line length. # Default: 100 max-len: 200 # Length of a tabulation. # Default: 4 tab-len: 8 # Shorten single-line comments. # Default: false shorten-comments: true # Default: true reformat-tags: false # Split chained methods on the dots as opposed to the arguments. # Default: true chain-split-dots: false exclusions: # Log a warning if an exclusion path is unused. # Default: false warn-unused: true # Mode of the generated files analysis. # # - `strict`: sources are excluded by strictly following the Go generated file convention. # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$` # This line must appear before the first non-comment, non-blank text in the file. # https://go.dev/s/generatedcode # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc. # - `disable`: disable the generated files exclusion. # # Default: lax generated: strict # Which file paths to exclude. # This option is ignored when using `--stdin` as the path is unknown. # Default: [] paths: - ".*\\.my\\.go$" - lib/bad.go issues: # Maximum issues count per one linter. # Set to 0 to disable. # Default: 50 max-issues-per-linter: 0 # Maximum count of issues with the same text. # Set to 0 to disable. # Default: 3 max-same-issues: 0 # Make issues output unique by line. # Default: true uniq-by-line: false # Show only new issues: if there are unstaged changes or untracked files, # only those changes are analyzed, else only changes in HEAD~ are analyzed. # It's a super-useful option for integration of golangci-lint into existing large codebase. # It's not practical to fix all existing issues at the moment of integration: # much better don't allow issues in new code. # # Default: false new: true # Show only new issues created after the best common ancestor (merge-base against HEAD). # Default: "" new-from-merge-base: main # Show only new issues created after git revision `REV`. # Default: "" new-from-rev: HEAD # Show only new issues created in git patch with set file path. # Default: "" new-from-patch: path/to/patch/file # Show issues in any part of update files (requires new-from-rev or new-from-patch). # Default: false whole-files: true # Apply the fixes detected by the linters and formatters (if it's supported by the linter). # Default: false fix: true # Output configuration options. output: # The formats used to render issues. formats: # Prints issues in a text format with colors, line number, and linter name. # This format is the default format. text: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.txt # Print linter name in the end of issue text. # Default: true print-linter-name: false # Print lines of code with issue. # Default: true print-issued-lines: false # Use colors. # Default: true colors: false # Prints issues in a JSON representation. json: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.json # Prints issues in columns representation separated by tabulations. tab: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.txt # Print linter name in the end of issue text. # Default: true print-linter-name: true # Use colors. # Default: true colors: false # Prints issues in an HTML page. # It uses the Cloudflare CDN (cdnjs) and React. html: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.html # Prints issues in the Checkstyle format. checkstyle: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.xml # Prints issues in the Code Climate format. code-climate: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.json # Prints issues in the JUnit XML format. junit-xml: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.xml # Support extra JUnit XML fields. # Default: false extended: true # Prints issues in the TeamCity format. teamcity: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.txt # Prints issues in the SARIF format. sarif: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.json # Add a prefix to the output file references. # This option is ignored when using `output.path-mode: abs` mode. # Default: "" path-prefix: "" # By default, the report are related to the path obtained by `run.relative-path-mode`. # The mode `abs` allows to show absolute file paths instead of relative file paths. # The option `output.path-prefix` is ignored when using `abs` mode. # Default: "" path-mode: "abs" # Order to use when sorting results. # Possible values: `file`, `linter`, and `severity`. # # If the severity values are inside the following list, they are ordered in this order: # 1. error # 2. warning # 3. high # 4. medium # 5. low # Either they are sorted alphabetically. # # Default: ["linter", "file"] sort-order: - linter - severity - file # filepath, line, and column. # Show statistics per linter. # Default: true show-stats: false # Options for analysis running. run: # Timeout for total work, e.g. 30s, 5m, 5m30s. # If the value is lower or equal to 0, the timeout is disabled. # Default: 0 (disabled) timeout: 5m # The mode used to evaluate relative paths. # It's used by exclusions, Go plugins, and some linters. # The value can be: # - `gomod`: the paths will be relative to the directory of the `go.mod` file. # - `gitroot`: the paths will be relative to the git root (the parent directory of `.git`). # - `cfg`: the paths will be relative to the configuration file. # - `wd` (NOT recommended): the paths will be relative to the place where golangci-lint is run. # Default: cfg relative-path-mode: gomod # Exit code when at least one issue was found. # Default: 1 issues-exit-code: 2 # Include test files or not. # Default: true tests: false # List of build tags, all linters use it. # Default: [] build-tags: - mytag # 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. # # Allowed values: readonly|vendor|mod # Default: "" modules-download-mode: readonly # Uses version control information during the loading of packages. # Default: false (implies `-buildvcs=false`) enable-build-vcs: true # Allow multiple parallel golangci-lint instances running. # If false, golangci-lint acquires file lock on start. # Default: false allow-parallel-runners: true # Allow multiple golangci-lint instances running, but serialize them around a lock. # If false, golangci-lint exits with an error if it fails to acquire file lock on start. # Default: false allow-serial-runners: true # Define the Go version limit. # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.22. go: '1.23' # Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously. # Default: 0 (automatically set to match Linux container CPU quota and # fall back to the number of logical CPUs in the machine) concurrency: 4 severity: # Set the default severity for issues. # # If severity rules are defined and the issues do not match or no severity is provided to the rule # this will be the default severity applied. # Severities should match the supported severity names of the selected out format. # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message # - TeamCity: https://www.jetbrains.com/help/teamcity/service-messages.html#Inspection+Instance # # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...) # # Default: "" default: error # When a list of severity rules are provided, severity information will be added to lint issues. # Severity rules have the same filtering capability as exclude rules # except you are allowed to specify one matcher per severity rule. # # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...) # # Only affects out formats that support setting severity information. # # Default: [] rules: - linters: - dupl severity: info ================================================ FILE: .golangci.reference.yml ================================================ # This file contains all available configuration options # with their default values (in comments). # # This file is not a configuration example, # it contains the exhaustive configuration with explanations of the options. # Defines the configuration version. # The only possible value is "2". version: "2" linters: # Default set of linters. # The value can be: # - `standard`: https://golangci-lint.run/docs/linters/#enabled-by-default # - `all`: enables all linters by default. # - `none`: disables all linters by default. # - `fast`: enables only linters considered as "fast" (`golangci-lint help linters --json | jq '[ .[] | select(.fast==true) ] | map(.name)'`). # Default: standard default: all # Enable specific linter. enable: - arangolint - asasalint - asciicheck - bidichk - bodyclose - canonicalheader - containedctx - contextcheck - copyloopvar - cyclop - decorder - depguard - dogsled - dupl - dupword - durationcheck - embeddedstructfieldcheck - err113 - errcheck - errchkjson - errname - errorlint - exhaustive - exhaustruct - exptostd - fatcontext - forbidigo - forcetypeassert - funcorder - funlen - ginkgolinter - gocheckcompilerdirectives - gochecknoglobals - gochecknoinits - gochecksumtype - gocognit - goconst - gocritic - gocyclo - godoclint - godot - godox - goheader - gomoddirectives - gomodguard - goprintffuncname - gosec - gosmopolitan - govet - grouper - iface - importas - inamedparam - ineffassign - interfacebloat - intrange - iotamixing - ireturn - lll - loggercheck - maintidx - makezero - mirror - misspell - mnd - modernize - musttag - nakedret - nestif - nilerr - nilnesserr - nilnil - nlreturn - noctx - noinlineerr - nolintlint - nonamedreturns - nosprintfhostport - paralleltest - perfsprint - prealloc - predeclared - promlinter - protogetter - reassign - recvcheck - revive - rowserrcheck - sloglint - spancheck - sqlclosecheck - staticcheck - tagalign - tagliatelle - testableexamples - testifylint - testpackage - thelper - tparallel - unconvert - unparam - unqueryvet - unused - usestdlibvars - usetesting - varnamelen - wastedassign - whitespace - wrapcheck - wsl - wsl_v5 - zerologlint # Disable specific linters. disable: - arangolint - asasalint - asciicheck - bidichk - bodyclose - canonicalheader - containedctx - contextcheck - copyloopvar - cyclop - decorder - depguard - dogsled - dupl - dupword - durationcheck - embeddedstructfieldcheck - err113 - errcheck - errchkjson - errname - errorlint - exhaustive - exhaustruct - exptostd - fatcontext - forbidigo - forcetypeassert - funcorder - funlen - ginkgolinter - gocheckcompilerdirectives - gochecknoglobals - gochecknoinits - gochecksumtype - gocognit - goconst - gocritic - gocyclo - godoclint - godot - godox - goheader - gomoddirectives - gomodguard - goprintffuncname - gosec - gosmopolitan - govet - grouper - iface - importas - inamedparam - ineffassign - interfacebloat - intrange - iotamixing - ireturn - lll - loggercheck - maintidx - makezero - mirror - misspell - mnd - modernize - musttag - nakedret - nestif - nilerr - nilnesserr - nilnil - nlreturn - noctx - noinlineerr - nolintlint - nonamedreturns - nosprintfhostport - paralleltest - perfsprint - prealloc - predeclared - promlinter - protogetter - reassign - recvcheck - revive - rowserrcheck - sloglint - spancheck - sqlclosecheck - staticcheck - tagalign - tagliatelle - testableexamples - testifylint - testpackage - thelper - tparallel - unconvert - unparam - unqueryvet - unused - usestdlibvars - usetesting - varnamelen - wastedassign - whitespace - wrapcheck - wsl - wsl_v5 - zerologlint # All available settings of specific linters. settings: asasalint: # To specify a set of function names to exclude. # The values are merged with the builtin exclusions. # The builtin exclusions can be disabled by setting `use-builtin-exclusions` to `false`. # Default: ["^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$"] exclude: - Append - \.Wrapf # To enable/disable the asasalint builtin exclusions of function names. # See the default value of `exclude` to get the builtin exclusions. # Default: true use-builtin-exclusions: false bidichk: # The following configurations check for all mentioned invisible Unicode runes. # All runes are enabled by default. left-to-right-embedding: false right-to-left-embedding: false pop-directional-formatting: false left-to-right-override: false right-to-left-override: false left-to-right-isolate: false right-to-left-isolate: false first-strong-isolate: false pop-directional-isolate: false copyloopvar: # Check all assigning the loop variable to another variable. # Default: false check-alias: true cyclop: # The maximal code complexity to report. # Default: 10 max-complexity: 10 # The maximal average package complexity. # If it's higher than 0.0 (float) the check is enabled. # Default: 0.0 package-average: 0.5 decorder: # Required order of `type`, `const`, `var` and `func` declarations inside a file. # Default: types before constants before variables before functions. dec-order: - type - const - var - func # If true, underscore vars (vars with "_" as the name) will be ignored at all checks. # Default: false (underscore vars are not ignored) ignore-underscore-vars: false # If true, order of declarations is not checked at all. # Default: true (disabled) disable-dec-order-check: false # If true, `init` func can be anywhere in file (does not have to be declared before all other functions). # Default: true (disabled) disable-init-func-first-check: false # If true, multiple global `type`, `const` and `var` declarations are allowed. # Default: true (disabled) disable-dec-num-check: false # If true, type declarations will be ignored for dec num check. # Default: false (type statements are not ignored) disable-type-dec-num-check: false # If true, const declarations will be ignored for dec num check. # Default: false (const statements are not ignored) disable-const-dec-num-check: false # If true, var declarations will be ignored for dec num check. # Default: false (var statements are not ignored) disable-var-dec-num-check: false depguard: # Rules to apply. # # Variables: # - File Variables # Use an exclamation mark `!` to negate a variable. # Example: `!$test` matches any file that is not a go test file. # # `$all` - matches all go files # `$test` - matches all go test files # # - Package Variables # # `$gostd` - matches all of go's standard library (Pulled from `GOROOT`) # # Default (applies if no custom rules are defined): Only allow $gostd in all files. rules: # Name of a rule. main: # Defines package matching behavior. Available modes: # - `original`: allowed if it doesn't match the deny list and either matches the allow list or the allow list is empty. # - `strict`: allowed only if it matches the allow list and either doesn't match the deny list or the allow rule is more specific (longer) than the deny rule. # - `lax`: allowed if it doesn't match the deny list or the allow rule is more specific (longer) than the deny rule. # Default: "original" list-mode: lax # List of file globs that will match this list of settings to compare against. # By default, if a path is relative, it is relative to the directory where the golangci-lint command is executed. # The placeholder '${base-path}' is substituted with a path relative to the mode defined with `run.relative-path-mode`. # The placeholder '${config-path}' is substituted with a path relative to the configuration file. # Default: $all files: - "!**/*_a _file.go" # List of allowed packages. # Entries can be a variable (starting with $), a string prefix, or an exact match (if ending with $). # Default: [] allow: - $gostd - github.com/OpenPeeDeeP # List of packages that are not allowed. # Entries can be a variable (starting with $), a string prefix, or an exact match (if ending with $). # Default: [] deny: - pkg: "math/rand$" desc: use math/rand/v2 - pkg: "github.com/sirupsen/logrus" desc: not allowed - pkg: "github.com/pkg/errors" desc: Should be replaced by standard lib errors package dogsled: # Checks assignments with too many blank identifiers. # Default: 2 max-blank-identifiers: 3 dupl: # Tokens count to trigger issue. # Default: 150 threshold: 100 dupword: # Keywords for detecting duplicate words. # If this list is not empty, only the words defined in this list will be detected. # Default: [] keywords: - "the" - "and" - "a" # Keywords used to ignore detection. # Default: [] ignore: - "0C0C" # Checks only comments, skip strings. # Default: false comments-only: true embeddedstructfieldcheck: # Checks that there is an empty space between the embedded fields and regular fields. # Default: true empty-line: false # Checks that sync.Mutex and sync.RWMutex are not used as embedded fields. # Default: false forbid-mutex: true errcheck: # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. # Such cases aren't reported by default. # Default: false check-type-assertions: true # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`. # Such cases aren't reported by default. # Default: false check-blank: true # To disable the errcheck built-in exclude list. # See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details. # Default: false disable-default-exclusions: true # List of functions to exclude from checking, where each entry is a single function to exclude. # See https://github.com/kisielk/errcheck#excluding-functions for details. exclude-functions: - io/ioutil.ReadFile - io.Copy(*bytes.Buffer) - io.Copy(os.Stdout) # Display function signature instead of selector. # Default: false verbose: true errchkjson: # With check-error-free-encoding set to true, errchkjson does warn about errors # from json encoding functions that are safe to be ignored, # because they are not possible to happen. # # if check-error-free-encoding is set to true and errcheck linter is enabled, # it is recommended to add the following exceptions to prevent from false positives: # # linters: # settings: # errcheck: # exclude-functions: # - encoding/json.Marshal # - encoding/json.MarshalIndent # # Default: false check-error-free-encoding: true # Issue on struct encoding that doesn't have exported fields. # Default: false report-no-exported: false errorlint: # Check whether fmt.Errorf uses the %w verb for formatting errors. # See the https://github.com/polyfloyd/go-errorlint for caveats. # Default: true errorf: false # Permit more than 1 %w verb, valid per Go 1.20 (requires `errorf: true`). # Default: true errorf-multi: false # Check for plain type assertions and type switches. # Default: true asserts: false # Check for plain error comparisons. # Default: true comparison: false # Allowed errors. # Default: [] allowed-errors: - err: "io.EOF" fun: "example.com/pkg.Read" # Allowed error "wildcards". # Default: [] allowed-errors-wildcard: - err: "example.com/pkg.ErrMagic" fun: "example.com/pkg.Magic" exhaustive: # Program elements to check for exhaustiveness. # Default: [ switch ] check: - switch - map # Presence of "default" case in switch statements satisfies exhaustiveness, # even if all enum members are not listed. # Default: false default-signifies-exhaustive: true # Enum members matching the supplied regex do not have to be listed in # switch statements to satisfy exhaustiveness. # Default: "" ignore-enum-members: "Example.+" # Enum types matching the supplied regex do not have to be listed in # switch statements to satisfy exhaustiveness. # Default: "" ignore-enum-types: "Example.+" # Consider enums only in package scopes, not in inner scopes. # Default: false package-scope-only: true # Only run exhaustive check on switches with "//exhaustive:enforce" comment. # Default: false explicit-exhaustive-switch: true # Only run exhaustive check on map literals with "//exhaustive:enforce" comment. # Default: false explicit-exhaustive-map: true # Switch statement requires default case even if exhaustive. # Default: false default-case-required: true exhaustruct: # List of regular expressions to match type names that should be processed. # Anonymous structs can be matched by '' alias. # # Each regular expression must match the full type name, including package path. # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`, # but not `http\.Cookie`. # Default: [] include: - '.+\.Test' - 'example\.com/package\.ExampleStruct[\d]{1,2}' # List of regular expressions to match type names that should be excluded from processing. # Anonymous structs can be matched by '' alias. # Has precedence over `include`. # Each regular expression must match the full type name, including package path. # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`, # but not `http\.Cookie`. # Default: [] exclude: - '.+/cobra\.Command$' # Allows empty structures, effectively excluding them from the check. # Default: false allow-empty: true # List of regular expressions to match type names that should be allowed to be empty. # Anonymous structs can be matched by '' alias. # Each regular expression must match the full type name, including package path. # For example, to match type `net/http.Cookie` regular expression should be `.*/http\.Cookie`, # but not `http\.Cookie`. # Default: [] allow-empty-rx: - '.*/http\.Cookie' # Allows empty structures in return statements. # Default: false allow-empty-returns: true # Allows empty structures in variable declarations. # Default: false allow-empty-declarations: true fatcontext: # Check for potential fat contexts in struct pointers. # May generate false positives. # Default: false check-struct-pointers: true forbidigo: # Forbid the following identifiers (list of regexp). # Default: ["^(fmt\\.Print(|f|ln)|print|println)$"] forbid: # Built-in bootstrapping functions. - pattern: ^print(ln)?$ # Optional message that gets included in error reports. - pattern: ^fmt\.Print.*$ msg: Do not commit print statements. # Alternatively, put messages at the end of the regex, surrounded by `(# )?`. # Escape any special characters. Those messages get included in error reports. - pattern: 'fmt\.Print.*(# Do not commit print statements\.)?' # Forbid spew Dump, whether it is called as function or method. # Depends on analyze-types below. - pattern: ^spew\.(ConfigState\.)?Dump$ # The package name might be ambiguous. # The full import path can be used as additional criteria. # Depends on analyze-types below. - pattern: ^v1.Dump$ pkg: ^example.com/pkg/api/v1$ # Exclude godoc examples from forbidigo checks. # Default: true exclude-godoc-examples: false # Instead of matching the literal source code, # use type information to replace expressions with strings that contain the package name # and (for methods and fields) the type name. # This makes it possible to handle import renaming and forbid struct fields and methods. # Default: false analyze-types: true funcorder: # Checks that constructors are placed after the structure declaration. # Default: true constructor: false # Checks if the exported methods of a structure are placed before the non-exported ones. # Default: true struct-method: false # Checks if the constructors and/or structure methods are sorted alphabetically. # Default: false alphabetical: true funlen: # Checks the number of lines in a function. # If lower than 0, disable the check. # Default: 60 lines: -1 # Checks the number of statements in a function. # If lower than 0, disable the check. # Default: 40 statements: -1 # Ignore comments when counting lines. # Default: true ignore-comments: false ginkgolinter: # Suppress the wrong length assertion warning. # Default: false suppress-len-assertion: true # Suppress the wrong nil assertion warning. # Default: false suppress-nil-assertion: true # Suppress the wrong error assertion warning. # Default: false suppress-err-assertion: true # Suppress the wrong comparison assertion warning. # Default: false suppress-compare-assertion: true # Suppress the function all in async assertion warning. # Default: false suppress-async-assertion: true # Suppress warning for comparing values from different types, like `int32` and `uint32`. # Default: false suppress-type-compare-assertion: true # Trigger warning for ginkgo focus containers like `FDescribe`, `FContext`, `FWhen` or `FIt`. # Default: false forbid-focus-container: true # Don't trigger warnings for HaveLen(0) # Default: false allow-havelen-zero: true # Force using `Expect` with `To`, `ToNot` or `NotTo`. # Reject using `Expect` with `Should` or `ShouldNot`. # Default: false force-expect-to: true # Best effort validation of async intervals (timeout and polling). # Ignored the `suppress-async-assertion` is true. # Default: false validate-async-intervals: true # Trigger a warning for variable assignments in ginkgo containers like `Describe`, `Context` and `When`, instead of in `BeforeEach()`. # Default: false forbid-spec-pollution: true # Force using the Succeed matcher for error functions, and the HaveOccurred matcher for non-function error values. # Default: false force-succeed: true # Force adding assertion descriptions to gomega matchers. # Default: false force-assertion-description: true # Force using `ToNot`, `ShouldNot` instead of `To(Not())`. # Default: false force-tonot: true gochecksumtype: # Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed. # Default: true default-signifies-exhaustive: false # Include shared interfaces in the exhaustiveness check. # Default: false include-shared-interfaces: true gocognit: # Minimal code complexity to report. # Default: 30 (but we recommend 10-20) min-complexity: 10 goconst: # Minimal length of string constant. # Default: 3 min-len: 2 # Minimum occurrences of constant string count to trigger issue. # Default: 3 min-occurrences: 2 # Look for existing constants matching the values. # Default: true match-constant: false # Search also for duplicated numbers. # Default: false numbers: true # Minimum value, only works with `goconst.numbers`. # Default: 3 min: 2 # Maximum value, only works with `goconst.numbers`. # Default: 3 max: 2 # Ignore when constant is not used as function argument. # Default: true ignore-calls: false # Exclude strings matching the given regular expression. # Default: "" ignore-string-values: - 'foo.+' # Detects constants with identical values. # Default: false find-duplicates: true # Evaluates of constant expressions like Prefix + "suffix". # Default: false eval-const-expressions: true gocritic: # Disable all checks. # Default: false disable-all: true # Which checks should be enabled in addition to default checks; can't be combined with 'disabled-checks'. # By default, list of stable checks is used (https://go-critic.com/overview#checks-overview): # appendAssign, argOrder, assignOp, badCall, badCond, captLocal, caseOrder, codegenComment, commentFormatting, # defaultCaseOrder, deprecatedComment, dupArg, dupBranchBody, dupCase, dupSubExpr, elseif, exitAfterDefer, # flagDeref, flagName, ifElseChain, mapKey, newDeref, offBy1, regexpMust, singleCaseSwitch, sloppyLen, # sloppyTypeAssert, switchTrue, typeSwitchVar, underef, unlambda, unslice, valSwap, wrapperFunc # To see which checks are enabled run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic`. enabled-checks: # Detects suspicious append result assignments. # https://go-critic.com/overview.html#appendassign - appendAssign # Detects `append` chains to the same slice that can be done in a single `append` call. # https://go-critic.com/overview.html#appendcombine - appendCombine # Detects suspicious arguments order. # https://go-critic.com/overview.html#argorder - argOrder # Detects assignments that can be simplified by using assignment operators. # https://go-critic.com/overview.html#assignop - assignOp # Detects suspicious function calls. # https://go-critic.com/overview.html#badcall - badCall # Detects suspicious condition expressions. # https://go-critic.com/overview.html#badcond - badCond # Detects suspicious mutex lock/unlock operations. # https://go-critic.com/overview.html#badlock - badLock # Detects suspicious regexp patterns. # https://go-critic.com/overview.html#badregexp - badRegexp # Detects bad usage of sort package. # https://go-critic.com/overview.html#badsorting - badSorting # Detects bad usage of sync.OnceFunc. # https://go-critic.com/overview.html#badsynconcefunc - badSyncOnceFunc # Detects bool expressions that can be simplified. # https://go-critic.com/overview.html#boolexprsimplify - boolExprSimplify # Detects when predeclared identifiers are shadowed in assignments. # https://go-critic.com/overview.html#builtinshadow - builtinShadow # Detects top-level declarations that shadow the predeclared identifiers. # https://go-critic.com/overview.html#builtinshadowdecl - builtinShadowDecl # Detects capitalized names for local variables. # https://go-critic.com/overview.html#captlocal - captLocal # Detects erroneous case order inside switch statements. # https://go-critic.com/overview.html#caseorder - caseOrder # Detects malformed 'code generated' file comments. # https://go-critic.com/overview.html#codegencomment - codegenComment # Detects comments with non-idiomatic formatting. # https://go-critic.com/overview.html#commentformatting - commentFormatting # Detects commented-out code inside function bodies. # https://go-critic.com/overview.html#commentedoutcode - commentedOutCode # Detects commented-out imports. # https://go-critic.com/overview.html#commentedoutimport - commentedOutImport # Detects when default case in switch isn't on 1st or last position. # https://go-critic.com/overview.html#defaultcaseorder - defaultCaseOrder # Detects loops inside functions that use defer. # https://go-critic.com/overview.html#deferinloop - deferInLoop # Detects deferred function literals that can be simplified. # https://go-critic.com/overview.html#deferunlambda - deferUnlambda # Detects malformed 'deprecated' doc-comments. # https://go-critic.com/overview.html#deprecatedcomment - deprecatedComment # Detects comments that silence go lint complaints about doc-comment. # https://go-critic.com/overview.html#docstub - docStub # Detects suspicious duplicated arguments. # https://go-critic.com/overview.html#duparg - dupArg # Detects duplicated branch bodies inside conditional statements. # https://go-critic.com/overview.html#dupbranchbody - dupBranchBody # Detects duplicated case clauses inside switch or select statements. # https://go-critic.com/overview.html#dupcase - dupCase # Detects multiple imports of the same package under different aliases. # https://go-critic.com/overview.html#dupimport - dupImport # Detects duplicated option function arguments in variadic function calls. # https://go-critic.com/overview.html#dupoption - dupOption # Detects suspicious duplicated sub-expressions. # https://go-critic.com/overview.html#dupsubexpr - dupSubExpr # Detects suspicious formatting strings usage. # https://go-critic.com/overview.html#dynamicfmtstring - dynamicFmtString # Detects else with nested if statement that can be replaced with else-if. # https://go-critic.com/overview.html#elseif - elseif # Detects suspicious empty declarations blocks. # https://go-critic.com/overview.html#emptydecl - emptyDecl # Detects fallthrough that can be avoided by using multi case values. # https://go-critic.com/overview.html#emptyfallthrough - emptyFallthrough # Detects empty string checks that can be written more idiomatically. # https://go-critic.com/overview.html#emptystringtest - emptyStringTest # Detects unoptimal strings/bytes case-insensitive comparison. # https://go-critic.com/overview.html#equalfold - equalFold # Detects unwanted dependencies on the evaluation order. # https://go-critic.com/overview.html#evalorder - evalOrder # Detects calls to exit/fatal inside functions that use defer. # https://go-critic.com/overview.html#exitafterdefer - exitAfterDefer # Detects exposed methods from sync.Mutex and sync.RWMutex. # https://go-critic.com/overview.html#exposedsyncmutex - exposedSyncMutex # Detects suspicious reassignment of error from another package. # https://go-critic.com/overview.html#externalerrorreassign - externalErrorReassign # Detects problems in filepath.Join() function calls. # https://go-critic.com/overview.html#filepathjoin - filepathJoin # Detects immediate dereferencing of `flag` package pointers. # https://go-critic.com/overview.html#flagderef - flagDeref # Detects suspicious flag names. # https://go-critic.com/overview.html#flagname - flagName # Detects hex literals that have mixed case letter digits. # https://go-critic.com/overview.html#hexliteral - hexLiteral # Detects nil usages in http.NewRequest calls, suggesting http.NoBody as an alternative. # https://go-critic.com/overview.html#httpnobody - httpNoBody # Detects params that incur excessive amount of copying. # https://go-critic.com/overview.html#hugeparam - hugeParam # Detects repeated if-else statements and suggests to replace them with switch statement. # https://go-critic.com/overview.html#ifelsechain - ifElseChain # Detects when imported package names shadowed in the assignments. # https://go-critic.com/overview.html#importshadow - importShadow # Detects strings.Index calls that may cause unwanted allocs. # https://go-critic.com/overview.html#indexalloc - indexAlloc # Detects non-assignment statements inside if/switch init clause. # https://go-critic.com/overview.html#initclause - initClause # Detects suspicious map literal keys. # https://go-critic.com/overview.html#mapkey - mapKey # Detects method expression call that can be replaced with a method call. # https://go-critic.com/overview.html#methodexprcall - methodExprCall # Finds where nesting level could be reduced. # https://go-critic.com/overview.html#nestingreduce - nestingReduce # Detects immediate dereferencing of `new` expressions. # https://go-critic.com/overview.html#newderef - newDeref # Detects return statements those results evaluate to nil. # https://go-critic.com/overview.html#nilvalreturn - nilValReturn # Detects old-style octal literals. # https://go-critic.com/overview.html#octalliteral - octalLiteral # Detects various off-by-one kind of errors. # https://go-critic.com/overview.html#offby1 - offBy1 # Detects if function parameters could be combined by type and suggest the way to do it. # https://go-critic.com/overview.html#paramtypecombine - paramTypeCombine # Detects expressions like []rune(s)[0] that may cause unwanted rune slice allocation. # https://go-critic.com/overview.html#preferdecoderune - preferDecodeRune # Detects concatenation with os.PathSeparator which can be replaced with filepath.Join. # https://go-critic.com/overview.html#preferfilepathjoin - preferFilepathJoin # Detects fmt.Sprint(f/ln) calls which can be replaced with fmt.Fprint(f/ln). # https://go-critic.com/overview.html#preferfprint - preferFprint # Detects w.Write or io.WriteString calls which can be replaced with w.WriteString. # https://go-critic.com/overview.html#preferstringwriter - preferStringWriter # Detects WriteRune calls with rune literal argument that is single byte and reports to use WriteByte instead. # https://go-critic.com/overview.html#preferwritebyte - preferWriteByte # Detects input and output parameters that have a type of pointer to referential type. # https://go-critic.com/overview.html#ptrtorefparam - ptrToRefParam # Detects append all its data while range it. # https://go-critic.com/overview.html#rangeappendall - rangeAppendAll # Detects expensive copies of `for` loop range expressions. # https://go-critic.com/overview.html#rangeexprcopy - rangeExprCopy # Detects loops that copy big objects during each iteration. # https://go-critic.com/overview.html#rangevalcopy - rangeValCopy # Detects redundant fmt.Sprint calls. # https://go-critic.com/overview.html#redundantsprint - redundantSprint # Detects `regexp.Compile*` that can be replaced with `regexp.MustCompile*`. # https://go-critic.com/overview.html#regexpmust - regexpMust # Detects suspicious regexp patterns. # https://go-critic.com/overview.html#regexppattern - regexpPattern # Detects regexp patterns that can be simplified. # https://go-critic.com/overview.html#regexpsimplify - regexpSimplify # Detects suspicious http.Error call without following return. # https://go-critic.com/overview.html#returnafterhttperror - returnAfterHttpError # Runs user-defined rules using ruleguard linter. # https://go-critic.com/overview.html#ruleguard - ruleguard # Detects switch statements that could be better written as if statement. # https://go-critic.com/overview.html#singlecaseswitch - singleCaseSwitch # Detects slice clear loops, suggests an idiom that is recognized by the Go compiler. # https://go-critic.com/overview.html#sliceclear - sliceClear # Detects usage of `len` when result is obvious or doesn't make sense. # https://go-critic.com/overview.html#sloppylen - sloppyLen # Detects suspicious/confusing re-assignments. # https://go-critic.com/overview.html#sloppyreassign - sloppyReassign # Detects redundant type assertions. # https://go-critic.com/overview.html#sloppytypeassert - sloppyTypeAssert # Detects suspicious sort.Slice calls. # https://go-critic.com/overview.html#sortslice - sortSlice # Detects "%s" formatting directives that can be replaced with %q. # https://go-critic.com/overview.html#sprintfquotedstring - sprintfQuotedString # Detects issue in Query() and Exec() calls. # https://go-critic.com/overview.html#sqlquery - sqlQuery # Detects string concat operations that can be simplified. # https://go-critic.com/overview.html#stringconcatsimplify - stringConcatSimplify # Detects redundant conversions between string and []byte. # https://go-critic.com/overview.html#stringxbytes - stringXbytes # Detects strings.Compare usage. # https://go-critic.com/overview.html#stringscompare - stringsCompare # Detects switch-over-bool statements that use explicit `true` tag value. # https://go-critic.com/overview.html#switchtrue - switchTrue # Detects sync.Map load+delete operations that can be replaced with LoadAndDelete. # https://go-critic.com/overview.html#syncmaploadanddelete - syncMapLoadAndDelete # Detects manual conversion to milli- or microseconds. # https://go-critic.com/overview.html#timeexprsimplify - timeExprSimplify # Detects TODO comments without detail/assignee. # https://go-critic.com/overview.html#todocommentwithoutdetail - todoCommentWithoutDetail # Detects function with too many results. # https://go-critic.com/overview.html#toomanyresultschecker - tooManyResultsChecker # Detects potential truncation issues when comparing ints of different sizes. # https://go-critic.com/overview.html#truncatecmp - truncateCmp # Detects repeated type assertions and suggests to replace them with type switch statement. # https://go-critic.com/overview.html#typeassertchain - typeAssertChain # Detects method declarations preceding the type definition itself. # https://go-critic.com/overview.html#typedeffirst - typeDefFirst # Detects type switches that can benefit from type guard clause with variable. # https://go-critic.com/overview.html#typeswitchvar - typeSwitchVar # Detects unneeded parenthesis inside type expressions and suggests to remove them. # https://go-critic.com/overview.html#typeunparen - typeUnparen # Detects unchecked errors in if statements. # https://go-critic.com/overview.html#uncheckedinlineerr - uncheckedInlineErr # Detects dereference expressions that can be omitted. # https://go-critic.com/overview.html#underef - underef # Detects redundant statement labels. # https://go-critic.com/overview.html#unlabelstmt - unlabelStmt # Detects function literals that can be simplified. # https://go-critic.com/overview.html#unlambda - unlambda # Detects unnamed results that may benefit from names. # https://go-critic.com/overview.html#unnamedresult - unnamedResult # Detects unnecessary braced statement blocks. # https://go-critic.com/overview.html#unnecessaryblock - unnecessaryBlock # Detects redundantly deferred calls. # https://go-critic.com/overview.html#unnecessarydefer - unnecessaryDefer # Detects slice expressions that can be simplified to sliced expression itself. # https://go-critic.com/overview.html#unslice - unslice # Detects value swapping code that are not using parallel assignment. # https://go-critic.com/overview.html#valswap - valSwap # Detects conditions that are unsafe due to not being exhaustive. # https://go-critic.com/overview.html#weakcond - weakCond # Ensures that `//nolint` comments include an explanation. # https://go-critic.com/overview.html#whynolint - whyNoLint # Detects function calls that can be replaced with convenience wrappers. # https://go-critic.com/overview.html#wrapperfunc - wrapperFunc # Detects Yoda style expressions and suggests to replace them. # https://go-critic.com/overview.html#yodastyleexpr - yodaStyleExpr # Detects bytes.Repeat with 0 value. # https://go-critic.com/overview.html#zerobyterepeat - zeroByteRepeat # Enable all checks. # Default: false enable-all: true # Which checks should be disabled; can't be combined with 'enabled-checks'. # Default: [] disabled-checks: - appendAssign - appendCombine - argOrder - assignOp - badCall - badCond - badLock - badRegexp - badSorting - badSyncOnceFunc - boolExprSimplify - builtinShadow - builtinShadowDecl - captLocal - caseOrder - codegenComment - commentFormatting - commentedOutCode - commentedOutImport - defaultCaseOrder - deferInLoop - deferUnlambda - deprecatedComment - docStub - dupArg - dupBranchBody - dupCase - dupImport - dupSubExpr - dynamicFmtString - elseif - emptyDecl - emptyFallthrough - emptyStringTest - equalFold - evalOrder - exitAfterDefer - exposedSyncMutex - externalErrorReassign - filepathJoin - flagDeref - flagName - hexLiteral - httpNoBody - hugeParam - ifElseChain - importShadow - indexAlloc - initClause - mapKey - methodExprCall - nestingReduce - newDeref - nilValReturn - octalLiteral - offBy1 - paramTypeCombine - preferDecodeRune - preferFilepathJoin - preferFprint - preferStringWriter - preferWriteByte - ptrToRefParam - rangeAppendAll - rangeExprCopy - rangeValCopy - redundantSprint - regexpMust - regexpPattern - regexpSimplify - returnAfterHttpError - ruleguard - singleCaseSwitch - sliceClear - sloppyLen - sloppyReassign - sloppyTypeAssert - sortSlice - sprintfQuotedString - sqlQuery - stringConcatSimplify - stringXbytes - stringsCompare - switchTrue - syncMapLoadAndDelete - timeExprSimplify - todoCommentWithoutDetail - tooManyResultsChecker - truncateCmp - typeAssertChain - typeDefFirst - typeSwitchVar - typeUnparen - uncheckedInlineErr - underef - unlabelStmt - unlambda - unnamedResult - unnecessaryBlock - unnecessaryDefer - unslice - valSwap - weakCond - whyNoLint - wrapperFunc - yodaStyleExpr # Enable multiple checks by tags in addition to default checks. # Run `GL_DEBUG=gocritic golangci-lint run --enable=gocritic` to see all tags and checks. # See https://github.com/go-critic/go-critic#usage -> section "Tags". # Default: [] enabled-tags: - diagnostic - style - performance - experimental - opinionated disabled-tags: - diagnostic - style - performance - experimental - opinionated # Settings passed to gocritic. # The settings key is the name of a supported gocritic checker. # The list of supported checkers can be found at https://go-critic.com/overview. settings: # Must be valid enabled check name. captLocal: # Whether to restrict checker to params only. # Default: true paramsOnly: false commentedOutCode: # Min length of the comment that triggers a warning. # Default: 15 minLength: 50 elseif: # Whether to skip balanced if-else pairs. # Default: true skipBalanced: false hugeParam: # Size in bytes that makes the warning trigger. # Default: 80 sizeThreshold: 70 ifElseChain: # Min number of if-else blocks that makes the warning trigger. # Default: 2 minThreshold: 4 nestingReduce: # Min number of statements inside a branch to trigger a warning. # Default: 5 bodyWidth: 4 rangeExprCopy: # Size in bytes that makes the warning trigger. # Default: 512 sizeThreshold: 516 # Whether to check test functions # Default: true skipTestFuncs: false rangeValCopy: # Size in bytes that makes the warning trigger. # Default: 128 sizeThreshold: 32 # Whether to check test functions. # Default: true skipTestFuncs: false ruleguard: # Enable debug to identify which 'Where' condition was rejected. # The value of the parameter is the name of a function in a ruleguard file. # # When a rule is evaluated: # If: # The Match() clause is accepted; and # One of the conditions in the Where() clause is rejected, # Then: # ruleguard prints the specific Where() condition that was rejected. # # The option is passed to the ruleguard 'debug-group' argument. # Default: "" debug: 'emptyDecl' # Determines the behavior when an error occurs while parsing ruleguard files. # If flag is not set, log error and skip rule files that contain an error. # If flag is set, the value must be a comma-separated list of error conditions. # - 'all': fail on all errors. # - 'import': ruleguard rule imports a package that cannot be found. # - 'dsl': gorule file does not comply with the ruleguard DSL. # Default: "" failOn: dsl,import # Comma-separated list of file paths containing ruleguard rules. # By default, if a path is relative, it is relative to the directory where the golangci-lint command is executed. # The placeholder '${base-path}' is substituted with a path relative to the mode defined with `run.relative-path-mode`. # The placeholder '${config-path}' is substituted with a path relative to the configuration file. # Glob patterns such as 'rules-*.go' may be specified. # Default: "" rules: '${base-path}/ruleguard/rules-*.go,${base-path}/myrule1.go' # Comma-separated list of enabled groups or skip empty to enable everything. # Tags can be defined with # character prefix. # Default: "" enable: "myGroupName,#myTagName" # Comma-separated list of disabled groups or skip empty to enable everything. # Tags can be defined with # character prefix. # Default: "" disable: "myGroupName,#myTagName" tooManyResultsChecker: # Maximum number of results. # Default: 5 maxResults: 10 truncateCmp: # Whether to skip int/uint/uintptr types. # Default: true skipArchDependent: false underef: # Whether to skip (*x).method() calls where x is a pointer receiver. # Default: true skipRecvDeref: false unnamedResult: # Whether to check exported functions. # Default: false checkExported: true gocyclo: # Minimal code complexity to report. # Default: 30 (but we recommend 10-20) min-complexity: 10 godoclint: # Default set of rules to enable. # Possible values are: `basic`, `all` or `none`. # Default: `basic` (enables `pkg-doc`, `single-pkg-doc`, `start-with-name`, and `deprecated`) default: all # List of rules to enable in addition to the default set. # Default: empty enable: # Check proper package-level godoc, if any. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#pkg-doc - pkg-doc # Assert at most one godoc per package. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#single-pkg-doc - single-pkg-doc # Require all packages to have a godoc. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-pkg-doc - require-pkg-doc # Assert symbol godocs start with the symbol name. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#start-with-name - start-with-name # Require godoc for all public symbols. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-doc - require-doc # Assert correct formatting of deprecation notes. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#deprecated - deprecated # Assert maximum line length for godocs. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#max-len - max-len # Assert no unused link in godocs. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#no-unused-link - no-unused-link # Require proper doc links to standard library declarations where applicable. # https://github.com/godoc-lint/godoc-lint?tab=readme-ov-file#require-stdlib-doclink - require-stdlib-doclink # List of rules to disable. # Default: empty disable: - pkg-doc - single-pkg-doc - require-pkg-doc - start-with-name - require-doc - deprecated - max-len - no-unused-link - require-stdlib-doclink # A map for fine-tuning individual rules. # All subkeys are optional. options: max-len: # Maximum line length for godocs, not including the `//`, `/*` or `*/` tokens. # Default: 77 length: 127 require-doc: # Ignore exported (public) symbols when applying the `require-doc` rule. # Default: false ignore-exported: true # Ignore unexported (private) symbols when applying the `require-doc` rule. # Default: true ignore-unexported: false start-with-name: # Include unexported symbols when applying the `start-with-name` rule. # Default: false include-unexported: true godot: # Comments to be checked: `declarations`, `toplevel`, `noinline` or `all`. # Default: declarations scope: toplevel # List of regexps for excluding particular comment lines from check. # Default: [] exclude: # Exclude todo and fixme comments. - "^fixme:" - "^todo:" # Check that each sentence ends with a period. # Default: true period: false # Check that each sentence starts with a capital letter. # Default: false capital: true godox: # Report any comments starting with keywords, this is useful for TODO or FIXME comments that # might be left in the code accidentally and should be resolved before merging. # Default: ["TODO", "BUG", "FIXME"] keywords: - NOTE - OPTIMIZE # marks code that should be optimized before merging - HACK # marks hack-around that should be removed before merging goheader: # Supports two types 'const` and `regexp`. # Values can be used recursively. # Default: {} values: const: # Define here const type values in format k:v. # For example: COMPANY: MY COMPANY regexp: # Define here regexp type values. # for example: AUTHOR: .*@mycompany\.com # The template used for checking. # Put here copyright header template for source code files. # Note: {{ YEAR }} is a builtin value that returns the year relative to the current machine time. # Default: "" template: |- {{ AUTHOR }} {{ COMPANY }} {{ YEAR }} SPDX-License-Identifier: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. # As alternative of directive 'template', you may put the path to file with the template source. # Useful if you need to load the template from a specific file. # By default, if a path is relative, it is relative to the directory where the golangci-lint command is executed. # The placeholder '${base-path}' is substituted with a path relative to the mode defined with `run.relative-path-mode`. # The placeholder '${config-path}' is substituted with a path relative to the configuration file. # Default: "" template-path: /path/to/my/template.tmpl gomoddirectives: # Allow local `replace` directives. # Default: false replace-local: true # List of allowed `replace` directives. # Default: [] replace-allow-list: - launchpad.net/gocheck # Allow to not explain why the version has been retracted in the `retract` directives. # Default: false retract-allow-no-explanation: true # Forbid the use of the `exclude` directives. # Default: false exclude-forbidden: true # Forbid the use of the `ignore` directives (>= go1.25). # Default: false ignore-forbidden: true # Forbid the use of the `toolchain` directive. # Default: false toolchain-forbidden: true # Defines a pattern to validate `toolchain` directive. # Default: '' (no match) toolchain-pattern: 'go1\.23\.\d+$' # Forbid the use of the `tool` directives. # Default: false tool-forbidden: true # Forbid the use of the `godebug` directive. # Default: false go-debug-forbidden: true # Defines a pattern to validate `go` minimum version directive. # Default: '' (no match) go-version-pattern: '\d\.\d+(\.0)?' # Check the validity of the module path. # Default: false check-module-path: true gomodguard: allowed: # List of allowed modules. # Default: [] modules: - gopkg.in/yaml.v2 # List of allowed module domains. # Default: [] domains: - golang.org blocked: # List of blocked modules. # Default: [] modules: # Blocked module. - github.com/uudashr/go-module: # Recommended modules that should be used instead. (Optional) recommendations: - golang.org/x/mod # Reason why the recommended module should be used. (Optional) reason: "`mod` is the official go.mod parser library." # List of blocked module version constraints. # Default: [] versions: # Blocked module with version constraint. - github.com/mitchellh/go-homedir: # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons. version: "< 1.1.0" # Reason why the version constraint exists. (Optional) reason: "testing if blocked version constraint works." # Set to true to raise lint issues for packages that are loaded from a local path via replace directive. # Default: false local-replace-directives: false gosec: # To select a subset of rules to run. # Available rules: https://github.com/securego/gosec#available-rules # Default: [] - means include all rules includes: - G101 # Look for hardcoded credentials - G102 # Bind to all interfaces - G103 # Audit the use of unsafe block - G104 # Audit errors not checked - G106 # Audit the use of ssh.InsecureIgnoreHostKey function - G107 # Url provided to HTTP request as taint input - G108 # Profiling endpoint is automatically exposed - G109 # Converting strconv.Atoi result to int32/int16 - G110 # Detect io.Copy instead of io.CopyN when decompression - G111 # Detect http.Dir('/') as a potential risk - G112 # Detect ReadHeaderTimeout not configured as a potential risk - G113 # HTTP request smuggling via conflicting headers or bare LF in body parsing - G114 # Use of net/http serve function that has no support for setting timeouts - G115 # Type conversion which leads to integer overflow - G116 # Detect Trojan Source attacks using bidirectional Unicode characters - G117 # Potential exposure of secrets via JSON/YAML/XML/TOML marshaling - G118 # Context propagation failure leading to goroutine/resource leaks - G119 # Unsafe redirect policy may propagate sensitive headers - G120 # Unbounded form parsing in HTTP handlers can cause memory exhaustion - G121 # Unsafe CrossOriginProtection bypass patterns - G122 # Filesystem TOCTOU race risk in filepath.Walk/WalkDir callbacks - G123 # TLS resumption may bypass VerifyPeerCertificate when VerifyConnection is unset - G201 # SQL query construction using format string - G202 # SQL query construction using string concatenation - G203 # Use of unescaped data in HTML templates - G204 # Audit use of command execution - G301 # Poor file permissions used when creating a directory - G302 # Poor file permissions used when creation file or using chmod - G303 # Creating tempfile using a predictable path - G304 # File path provided as taint input - G305 # File path traversal when extracting zip archive - G306 # Poor file permissions used when writing to a file - G307 # Poor file permissions used when creating a file with os.Create - G401 # Detect the usage of MD5 or SHA1 - G402 # Look for bad TLS connection settings - G403 # Ensure minimum RSA key length of 2048 bits - G404 # Insecure random number source (rand) - G405 # Detect the usage of DES or RC4 - G406 # Detect the usage of deprecated MD4 or RIPEMD160 - G408 # Stateful misuse of ssh.PublicKeyCallback leading to auth bypass - G501 # Import blocklist: crypto/md5 - G502 # Import blocklist: crypto/des - G503 # Import blocklist: crypto/rc4 - G504 # Import blocklist: net/http/cgi - G505 # Import blocklist: crypto/sha1 - G506 # Import blocklist: golang.org/x/crypto/md4 - G507 # Import blocklist: golang.org/x/crypto/ripemd160 - G601 # Implicit memory aliasing in RangeStmt - G602 # Possible slice bounds out of range - G701 # SQL injection via taint analysis - G702 # Command injection via taint analysis - G703 # Path traversal via taint analysis - G704 # SSRF via taint analysis - G705 # XSS via taint analysis - G706 # Log injection via taint analysis - G707 # SMTP command/header injection via taint analysis # To specify a set of rules to explicitly exclude. # Available rules: https://github.com/securego/gosec#available-rules # Default: [] excludes: - G101 # Look for hardcoded credentials - G102 # Bind to all interfaces - G103 # Audit the use of unsafe block - G104 # Audit errors not checked - G106 # Audit the use of ssh.InsecureIgnoreHostKey function - G107 # Url provided to HTTP request as taint input - G108 # Profiling endpoint is automatically exposed - G109 # Converting strconv.Atoi result to int32/int16 - G110 # Detect io.Copy instead of io.CopyN when decompression - G111 # Detect http.Dir('/') as a potential risk - G112 # Detect ReadHeaderTimeout not configured as a potential risk - G114 # Use of net/http serve function that has no support for setting timeouts - G115 # Type conversion which leads to integer overflow - G116 # Detect Trojan Source attacks using bidirectional Unicode characters - G201 # SQL query construction using format string - G202 # SQL query construction using string concatenation - G203 # Use of unescaped data in HTML templates - G204 # Audit use of command execution - G301 # Poor file permissions used when creating a directory - G302 # Poor file permissions used when creation file or using chmod - G303 # Creating tempfile using a predictable path - G304 # File path provided as taint input - G305 # File path traversal when extracting zip archive - G306 # Poor file permissions used when writing to a file - G307 # Poor file permissions used when creating a file with os.Create - G401 # Detect the usage of MD5 or SHA1 - G402 # Look for bad TLS connection settings - G403 # Ensure minimum RSA key length of 2048 bits - G404 # Insecure random number source (rand) - G405 # Detect the usage of DES or RC4 - G406 # Detect the usage of deprecated MD4 or RIPEMD160 - G501 # Import blocklist: crypto/md5 - G502 # Import blocklist: crypto/des - G503 # Import blocklist: crypto/rc4 - G504 # Import blocklist: net/http/cgi - G505 # Import blocklist: crypto/sha1 - G506 # Import blocklist: golang.org/x/crypto/md4 - G507 # Import blocklist: golang.org/x/crypto/ripemd160 - G601 # Implicit memory aliasing in RangeStmt - G602 # Possible slice bounds out of range # Filter out the issues with a lower severity than the given value. # Valid options are: low, medium, high. # Default: low severity: medium # Filter out the issues with a lower confidence than the given value. # Valid options are: low, medium, high. # Default: low confidence: medium # Concurrency value. # Default: the number of logical CPUs usable by the current process. concurrency: 12 # To specify the configuration of rules. config: # Globals are applicable to all rules. global: # If true, ignore #nosec in comments (and an alternative as well). # Default: false nosec: true # Add an alternative comment prefix to #nosec (both will work at the same time). # Default: "" "#nosec": "#my-custom-nosec" # Define whether nosec issues are counted as finding or not. # Default: false show-ignored: true # Audit mode enables addition checks that for normal code analysis might be too nosy. # Default: false audit: true G101: # Regexp pattern for variables and constants to find. # Default: "(?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|cred" pattern: "(?i)example" # If true, complain about all cases (even with low entropy). # Default: false ignore_entropy: false # Maximum allowed entropy of the string. # Default: "80.0" entropy_threshold: "80.0" # Maximum allowed value of entropy/string length. # Is taken into account if entropy >= entropy_threshold/2. # Default: "3.0" per_char_threshold: "3.0" # Calculate entropy for first N chars of the string. # Default: "16" truncate: "32" # Additional functions to ignore while checking unhandled errors. # Following functions always ignored: # bytes.Buffer: # - Write # - WriteByte # - WriteRune # - WriteString # fmt: # - Print # - Printf # - Println # - Fprint # - Fprintf # - Fprintln # strings.Builder: # - Write # - WriteByte # - WriteRune # - WriteString # io.PipeWriter: # - CloseWithError # hash.Hash: # - Write # os: # - Unsetenv # Default: {} G104: fmt: - Fscanf G111: # Regexp pattern to find potential directory traversal. # Default: "http\\.Dir\\(\"\\/\"\\)|http\\.Dir\\('\\/'\\)" pattern: "custom\\.Dir\\(\\)" # Maximum allowed permissions mode for os.Mkdir and os.MkdirAll. # Default: "0750" G301: "0750" # Maximum allowed permissions mode for os.OpenFile and os.Chmod. # Default: "0600" G302: "0600" # Maximum allowed permissions mode for os.WriteFile and ioutil.WriteFile. # Default: "0600" G306: "0600" gosmopolitan: # Allow and ignore `time.Local` usages. # # Default: false allow-time-local: true # List of fully qualified names in the `full/pkg/path.name` form, to act as "i18n escape hatches". # String literals inside call-like expressions to, or struct literals of those names, # are exempt from the writing system check. # # Default: [] escape-hatches: - 'github.com/nicksnyder/go-i18n/v2/i18n.Message' - 'example.com/your/project/i18n/markers.Raw' - 'example.com/your/project/i18n/markers.OK' - 'example.com/your/project/i18n/markers.TODO' - 'command-line-arguments.Simple' # List of Unicode scripts to watch for any usage in string literals. # https://pkg.go.dev/unicode#pkg-variables # # Default: ["Han"] watch-for-scripts: - Devanagari - Han - Hangul - Hiragana - Katakana govet: # Disable all analyzers. # Default: false disable-all: true # Enable analyzers by name. # (In addition to default: # appends, asmdecl, assign, atomic, bools, buildtag, cgocall, composites, copylocks, defers, directive, errorsas, # framepointer, httpresponse, ifaceassert, loopclosure, lostcancel, nilfunc, printf, shift, sigchanyzer, slog, # stdmethods, stringintconv, structtag, testinggoroutine, tests, timeformat, unmarshal, unreachable, unsafeptr, # unusedresult # ). # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers. # Default: [] enable: # Check for missing values after append. - appends # Report mismatches between assembly files and Go declarations. - asmdecl # Check for useless assignments. - assign # Check for common mistakes using the sync/atomic package. - atomic # Check for non-64-bits-aligned arguments to sync/atomic functions. - atomicalign # Check for common mistakes involving boolean operators. - bools # Check //go:build and // +build directives. - buildtag # Detect some violations of the cgo pointer passing rules. - cgocall # Check for unkeyed composite literals. - composites # Check for locks erroneously passed by value. - copylocks # Check for calls of reflect.DeepEqual on error values. - deepequalerrors # Report common mistakes in defer statements. - defers # Check Go toolchain directives such as //go:debug. - directive # Report passing non-pointer or non-error values to errors.As. - errorsas # Find structs that would use less memory if their fields were sorted. - fieldalignment # Find calls to a particular function. - findcall # Report assembly that clobbers the frame pointer before saving it. - framepointer # Check format of addresses passed to net.Dial. - hostport # Report using Go 1.22 enhanced ServeMux patterns in older Go versions. - httpmux # Check for mistakes using HTTP responses. - httpresponse # Detect impossible interface-to-interface type assertions. - ifaceassert # Check references to loop variables from within nested functions. - loopclosure # Check cancel func returned by context.WithCancel is called. - lostcancel # Check for useless comparisons between functions and nil. - nilfunc # Check for redundant or impossible nil comparisons. - nilness # Check consistency of Printf format strings and arguments. - printf # Check for comparing reflect.Value values with == or reflect.DeepEqual. - reflectvaluecompare # Check for possible unintended shadowing of variables. - shadow # Check for shifts that equal or exceed the width of the integer. - shift # Check for unbuffered channel of os.Signal. - sigchanyzer # Check for invalid structured logging calls. - slog # Check the argument type of sort.Slice. - sortslice # Check signature of methods of well-known interfaces. - stdmethods # Report uses of too-new standard library symbols. - stdversion # Check for string(int) conversions. - stringintconv # Check that struct field tags conform to reflect.StructTag.Get. - structtag # Report calls to (*testing.T).Fatal from goroutines started by a test. - testinggoroutine # Check for common mistaken usages of tests and examples. - tests # Check for calls of (time.Time).Format or time.Parse with 2006-02-01. - timeformat # Report passing non-pointer or non-interface values to unmarshal. - unmarshal # Check for unreachable code. - unreachable # Check for invalid conversions of uintptr to unsafe.Pointer. - unsafeptr # Check for unused results of calls to some functions. - unusedresult # Checks for unused writes. - unusedwrite # Check for misuses of sync.WaitGroup. - waitgroup # Enable all analyzers. # Default: false enable-all: true # Disable analyzers by name. # (In addition to default # atomicalign, deepequalerrors, fieldalignment, findcall, nilness, reflectvaluecompare, shadow, sortslice, # timeformat, unusedwrite # ). # Run `GL_DEBUG=govet golangci-lint run --enable=govet` to see default, all available analyzers, and enabled analyzers. # Default: [] disable: - appends - asmdecl - assign - atomic - atomicalign - bools - buildtag - cgocall - composites - copylocks - deepequalerrors - defers - directive - errorsas - fieldalignment - findcall - framepointer - hostport - httpmux - httpresponse - ifaceassert - loopclosure - lostcancel - nilfunc - nilness - printf - reflectvaluecompare - shadow - shift - sigchanyzer - slog - sortslice - stdmethods - stdversion - stringintconv - structtag - testinggoroutine - tests - timeformat - unmarshal - unreachable - unsafeptr - unusedresult - unusedwrite - waitgroup # Settings per analyzer. settings: # Analyzer name, run `go tool vet help` to see all analyzers. printf: # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). # Default: [] funcs: - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Infof - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Warnf - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Errorf - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Fatalf shadow: # Whether to be strict about shadowing; can be noisy. # Default: false strict: true unusedresult: # Comma-separated list of functions whose results must be used. # (In addition to default: # context.WithCancel, context.WithDeadline, context.WithTimeout, context.WithValue, errors.New, fmt.Errorf, # fmt.Sprint, fmt.Sprintf, sort.Reverse # ). # Default: [] funcs: - pkg.MyFunc # Comma-separated list of names of methods of type func() string whose results must be used. # (In addition to default Error,String). # Default: [] stringmethods: - MyMethod grouper: # Require the use of a single global 'const' declaration only. # Default: false const-require-single-const: true # Require the use of grouped global 'const' declarations. # Default: false const-require-grouping: true # Require the use of a single 'import' declaration only. # Default: false import-require-single-import: true # Require the use of grouped 'import' declarations. # Default: false import-require-grouping: true # Require the use of a single global 'type' declaration only. # Default: false type-require-single-type: true # Require the use of grouped global 'type' declarations. # Default: false type-require-grouping: true # Require the use of a single global 'var' declaration only. # Default: false var-require-single-var: true # Require the use of grouped global 'var' declarations. # Default: false var-require-grouping: true iface: # List of analyzers. # Default: ["identical"] enable: - identical # Identifies interfaces in the same package that have identical method sets. - unused # Identifies interfaces that are not used anywhere in the same package where the interface is defined. - opaque # Identifies functions that return interfaces, but the actual returned value is always a single concrete implementation. - unexported # Identifies interfaces that are not exported but are used in exported functions or methods. settings: unused: # List of packages path to exclude from the check. # Default: [] exclude: - github.com/example/log importas: # Do not allow unaliased imports of aliased packages. # Default: false no-unaliased: true # Do not allow non-required aliases. # Default: false no-extra-aliases: true # List of aliases # Default: [] alias: # Using `servingv1` alias for `knative.dev/serving/pkg/apis/serving/v1` package. - pkg: knative.dev/serving/pkg/apis/serving/v1 alias: servingv1 # Using `autoscalingv1alpha1` alias for `knative.dev/serving/pkg/apis/autoscaling/v1alpha1` package. - pkg: knative.dev/serving/pkg/apis/autoscaling/v1alpha1 alias: autoscalingv1alpha1 # You can specify the package path by regular expression, # and alias by regular expression expansion syntax like below. # See https://github.com/julz/importas#use-regular-expression for details. - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+) alias: $1$2 # An explicit empty alias can be used to ensure no aliases are used for a package. # This can be useful if `no-extra-aliases: true` doesn't fit your need. # Multiple packages can use an empty alias. - pkg: errors alias: "" inamedparam: # Skips check for interface methods with only a single parameter. # Default: false skip-single-param: true ineffassign: # Check escaping variables of type error, may cause false positives. # Default: false check-escaping-errors: true interfacebloat: # The maximum number of methods allowed for an interface. # Default: 10 max: 5 iotamixing: # Whether to report individual consts rather than just the const block. # Default: false report-individual: true ireturn: # List of interfaces to allow. # Lists of the keywords and regular expressions matched to interface or package names can be used. # `allow` and `reject` settings cannot be used at the same time. # # Keywords: # - `empty` for `interface{}` # - `error` for errors # - `stdlib` for standard library # - `anon` for anonymous interfaces # - `generic` for generic interfaces added in go 1.18 # # Default: [anon, error, empty, stdlib] allow: - anon # You can specify idiomatic endings for interface - (or|er)$ # List of interfaces to reject. # Lists of the keywords and regular expressions matched to interface or package names can be used. # `allow` and `reject` settings cannot be used at the same time. # # Keywords: # - `empty` for `interface{}` # - `error` for errors # - `stdlib` for standard library # - `anon` for anonymous interfaces # - `generic` for generic interfaces added in go 1.18 # # Default: [] reject: - github.com\/user\/package\/v4\.Type lll: # Max line length, lines longer will be reported. # '\t' is counted as 1 character by default, and can be changed with the tab-width option. # Default: 120. line-length: 120 # Tab width in spaces. # Default: 1 tab-width: 1 loggercheck: # Allow check for the github.com/go-kit/log library. # Default: true kitlog: false # Allow check for the k8s.io/klog/v2 library. # Default: true klog: false # Allow check for the github.com/go-logr/logr library. # Default: true logr: false # Allow check for the log/slog library. # Default: true slog: false # Allow check for the "sugar logger" from go.uber.org/zap library. # Default: true zap: false # Require all logging keys to be inlined constant strings. # Default: false require-string-key: true # Require printf-like format specifier (%s, %d for example) not present. # Default: false no-printf-like: true # List of custom rules to check against, where each rule is a single logger pattern, useful for wrapped loggers. # For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt # Default: empty rules: - k8s.io/klog/v2.InfoS # package level exported functions - (github.com/go-logr/logr.Logger).Error # "Methods" - (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver maintidx: # Show functions with maintainability index lower than N. # A high index indicates better maintainability (it's kind of the opposite of complexity). # Default: 20 under: 100 makezero: # Allow only slices initialized with a length of zero. # Default: false always: true misspell: # Correct spellings using locale preferences for US or UK. # Setting locale to US will correct the British spelling of 'colour' to 'color'. # Default is to use a neutral variety of English. locale: US # Typos to ignore. # Should be in lower case. # Default: [] ignore-rules: - someword # Extra word corrections. # `typo` and `correction` should only contain letters. # The words are case-insensitive. # Default: [] extra-words: - typo: "iff" correction: "if" - typo: "cancelation" correction: "cancellation" # Mode of the analysis: # - default: checks all the file content. # - restricted: checks only comments. # Default: "" mode: restricted mnd: # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. # Default: ["argument", "case", "condition", "operation", "return", "assign"] checks: - argument - case - condition - operation - return - assign # List of numbers to exclude from analysis. # The numbers should be written as string. # Values always ignored: "1", "1.0", "0" and "0.0". # Default: [] ignored-numbers: - '0666' - '0755' - '42' # List of file patterns to exclude from analysis. # Values always ignored: `.+_test.go`. # Default: [] ignored-files: - 'magic1_.+\.go$' # List of function patterns to exclude from analysis. # Following functions are always ignored: `time.Date`, # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`, # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`. # Default: [] ignored-functions: - '^math\.' - '^http\.StatusText$' modernize: # List of analyzers to disable. # By default, all analyzers are enabled. disable: # Replace interface{} with any. - any # Replace []byte(fmt.Sprintf) with fmt.Appendf. - fmtappendf # Remove redundant re-declaration of loop variables. - forvar # Replace explicit loops over maps with calls to maps package. - mapsloop # Replace if/else statements with calls to min or max. - minmax # Simplify code by using go1.26's new(expr). - newexpr # Suggest replacing omitempty with omitzero for struct fields. - omitzero # Remove obsolete //+build comments. - plusbuild # Replace 3-clause for loops with for-range over integers. - rangeint # Replace reflect.TypeOf(x) with TypeFor[T](). - reflecttypefor # Replace loops with slices.Contains or slices.ContainsFunc. - slicescontains # Replace sort.Slice with slices.Sort for basic types. - slicessort # Use iterators instead of Len/At-style APIs. - stditerators # Replace strings.Index etc. with strings.Cut. - stringscut # Replace HasPrefix/TrimPrefix with CutPrefix. - stringscutprefix # Replace ranging over Split/Fields with SplitSeq/FieldsSeq. - stringsseq # Replace += with strings.Builder. - stringsbuilder # Replace context.WithCancel with t.Context in tests. - testingcontext # Replace unsafe pointer arithmetic with function calls. - unsafefuncs # Replace wg.Add(1)/go/wg.Done() with wg.Go. - waitgroup musttag: # A set of custom functions to check in addition to the builtin ones. # Default: json, xml, gopkg.in/yaml.v3, BurntSushi/toml, mitchellh/mapstructure, jmoiron/sqlx functions: # The full name of the function, including the package. - name: github.com/hashicorp/hcl/v2/hclsimple.DecodeFile # The struct tag whose presence should be ensured. tag: hcl # The position of the argument to check. arg-pos: 2 nakedret: # Make an issue if func has more lines of code than this setting, and it has naked returns. # Default: 30 max-func-lines: 31 nestif: # Minimal complexity of if statements to report. # Default: 5 min-complexity: 4 nilnil: # To check functions with only two return values (`return nil, nil`). # If disabled then returns like `return nil, nil, ..., nil` are supported. # Default: true only-two: false # In addition, detect opposite situation (simultaneous return of non-nil error and valid value). # E.g, `return clone, fh.indexer.Update(clone)` will be considered as invalid. # Default: false detect-opposite: true # List of return types to check. # Default: ["chan", "func", "iface", "map", "ptr", "uintptr", "unsafeptr"] checked-types: - chan - func - iface - map - ptr - uintptr - unsafeptr nlreturn: # Size of the block (including return statement that is still "OK"), # so no return split required. # Default: 1 block-size: 2 nolintlint: # Disable to ensure that all nolint directives actually have an effect. # Default: false allow-unused: true # Exclude following linters from requiring an explanation. # Default: [] allow-no-explanation: [ ] # Enable to require an explanation of nonzero length after each nolint directive. # Default: false require-explanation: true # Enable to require nolint directives to mention the specific linter being suppressed. # Default: false require-specific: true nonamedreturns: # Report named error if it is assigned inside defer. # Default: false report-error-in-defer: true paralleltest: # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it. # Default: false ignore-missing: true # Ignore missing calls to `t.Parallel()` in subtests. Top-level tests are # still required to have `t.Parallel`, but subtests are allowed to skip it. # Default: false ignore-missing-subtests: true perfsprint: # Enable/disable optimization of integer formatting. # Default: true integer-format: false # Optimizes even if it requires an int or uint type cast. # Default: true int-conversion: false # Enable/disable optimization of error formatting. # Default: true error-format: false # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors. # Default: false err-error: true # Optimizes `fmt.Errorf`. # Default: true errorf: false # Enable/disable optimization of string formatting. # Default: true string-format: false # Optimizes `fmt.Sprintf` with only one argument. # Default: true sprintf1: false # Optimizes into strings concatenation. # Default: true strconcat: false # Enable/disable optimization of bool formatting. # Default: true bool-format: false # Enable/disable optimization of hex formatting. # Default: true hex-format: false # Enable/disable optimization of concat loop. # Default: true concat-loop: false # Optimization of `concat-loop` even with other operations. # Default: false loop-other-ops: true prealloc: # IMPORTANT: we don't recommend using this linter before doing performance profiling. # For most programs usage of prealloc will be a premature optimization. # Report pre-allocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. # Default: true simple: false # Report pre-allocation suggestions on range loops. # Default: true range-loops: false # Report pre-allocation suggestions on for loops. # Default: false for-loops: true predeclared: # List of predeclared identifiers to not report on. # Default: [] ignore: - new - int # Include method names and field names in checks. # Default: false qualified-name: true promlinter: # Promlinter cannot infer all metrics name in static analysis. # Enable strict mode will also include the errors caused by failing to parse the args. # Default: false strict: true # Please refer to https://github.com/yeya24/promlinter#usage for detailed usage. # Default: [] disabled-linters: # Help detects issues related to the help text for a metric. - Help # MetricUnits detects issues with metric unit names. - MetricUnits # Counter detects issues specific to counters, as well as patterns that should only be used with counters. - Counter # HistogramSummaryReserved detects when other types of metrics use names or labels reserved for use by histograms and/or summaries. - HistogramSummaryReserved # MetricTypeInName detects when metric types are included in the metric name. - MetricTypeInName # ReservedChars detects colons in metric names. - ReservedChars # CamelCase detects metric names and label names written in camelCase. - CamelCase # UnitAbbreviations detects abbreviated units in the metric name. - UnitAbbreviations protogetter: # Skip files generated by specified generators from the checking. # Checks only the file's initial comment, which must follow the format: "// Code generated by ". # Files generated by protoc-gen-go, protoc-gen-go-grpc, and protoc-gen-grpc-gateway are always excluded automatically. # Default: [] skip-generated-by: ["protoc-gen-go-my-own-generator"] # Skip files matching the specified glob pattern from the checking. # Default: [] skip-files: - "*.pb.go" - "*/vendor/*" - "/full/path/to/file.go" # Skip any generated files from the checking. # Default: false skip-any-generated: true # Skip first argument of append function. # Default: false replace-first-arg-in-append: true reassign: # Patterns for global variable names that are checked for reassignment. # See https://github.com/curioswitch/go-reassign#usage # Default: ["EOF", "Err.*"] patterns: - ".*" recvcheck: # Disables the built-in method exclusions: # - `MarshalText` # - `MarshalJSON` # - `MarshalYAML` # - `MarshalXML` # - `MarshalBinary` # - `GobEncode` # Default: false disable-builtin: true # User-defined method exclusions. # The format is `struct_name.method_name` (ex: `Foo.MethodName`). # A wildcard `*` can use as a struct name (ex: `*.MethodName`). # Default: [] exclusions: - "*.Value" revive: # Maximum number of open files at the same time. # See https://github.com/mgechev/revive#command-line-flags # Defaults to unlimited. max-open-files: 2048 # Sets the default severity. # See https://github.com/mgechev/revive#configuration # Default: warning severity: error # Enable all available rules. # Default: false enable-all-rules: true # By default, the default rules are enabled, # but if you explicitly define or configure a rule, the default rules will be disabled. # This option, when set to `true`, allows you to avoid explicitly redefining default rules when adding a rule. # Default: false enable-default-rules: true # Enable validation of comment directives. # See https://github.com/mgechev/revive#comment-directives directives: - name: specify-disable-reason severity: error # Sets the default failure confidence. # This means that linting errors with less than 0.8 confidence will be ignored. # Default: 0.8 confidence: 0.1 # Revive handles the default rules in a way that can be unexpected: # - If there are no explicit rules, the default rules are used. # - If there is at least one explicit rule, the default rules are not used, unless `enable-default-rules` is `true`. # Run `GL_DEBUG=revive golangci-lint run --enable-only=revive` to see default, all available rules, and enabled rules. rules: # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#add-constant - name: add-constant severity: warning disabled: false exclude: [""] arguments: - max-lit-count: "3" allow-strs: '""' allow-ints: "0,1,2" allow-floats: "0.0,0.,1.0,1.,2.0,2." # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#argument-limit - name: argument-limit severity: warning disabled: false exclude: [""] arguments: [ 4 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#atomic - name: atomic severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#banned-characters - name: banned-characters severity: warning disabled: false exclude: [""] arguments: [ "Ω","Σ","σ", "7" ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#bare-return - name: bare-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#blank-imports - name: blank-imports severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#bool-literal-in-expr - name: bool-literal-in-expr severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#call-to-gc - name: call-to-gc severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#cognitive-complexity - name: cognitive-complexity severity: warning disabled: false exclude: [""] arguments: [ 7 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#comment-spacings - name: comment-spacings severity: warning disabled: false exclude: [""] arguments: - mypragma - otherpragma # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#comments-density - name: comments-density severity: warning disabled: false exclude: [""] arguments: [ 15 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#confusing-naming - name: confusing-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#confusing-results - name: confusing-results severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#constant-logical-expr - name: constant-logical-expr severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#context-as-argument - name: context-as-argument severity: warning disabled: false exclude: [""] arguments: - allow-types-before: "*testing.T,*github.com/user/repo/testing.Harness" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#context-keys-type - name: context-keys-type severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#cyclomatic - name: cyclomatic severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#datarace - name: datarace severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#deep-exit - name: deep-exit severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#defer - name: defer severity: warning disabled: false exclude: [""] arguments: - "call-chain" - "loop" - "method-call" - "recover" - "immediate-recover" - "return" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#dot-imports - name: dot-imports severity: warning disabled: false exclude: [""] arguments: - allowed-packages: ["github.com/onsi/ginkgo/v2", "github.com/onsi/gomega"] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#duplicated-imports - name: duplicated-imports severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#early-return - name: early-return severity: warning disabled: false exclude: [""] arguments: - "preserve-scope" - "allow-jump" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#empty-block - name: empty-block severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#empty-lines - name: empty-lines severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-map-style - name: enforce-map-style severity: warning disabled: false exclude: [""] arguments: - "make" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-repeated-arg-type-style - name: enforce-repeated-arg-type-style severity: warning disabled: false exclude: [""] arguments: - "short" # Or this parameter: - func-arg-style: "full" func-ret-val-style: "short" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-slice-style - name: enforce-slice-style severity: warning disabled: false exclude: [""] arguments: - "make" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#enforce-switch-style - name: enforce-switch-style severity: warning disabled: false exclude: [""] arguments: [ "allowNoDefault" ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#epoch-naming - name: epoch-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#error-naming - name: error-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#error-return - name: error-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#error-strings - name: error-strings severity: warning disabled: false exclude: [""] arguments: - "xerrors.New" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#errorf - name: errorf severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#exported - name: exported severity: warning disabled: false exclude: [""] arguments: - "check-private-receivers" - "disable-stuttering-check" - "say-repetitive-instead-of-stutters" - "check-public-interface" - "disable-checks-on-constants" - "disable-checks-on-functions" - "disable-checks-on-methods" - "disable-checks-on-types" - "disable-checks-on-variables" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#file-header - name: file-header severity: warning disabled: false exclude: [""] arguments: - This is the text that must appear at the top of source files. # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#file-length-limit - name: file-length-limit severity: warning disabled: false exclude: [""] arguments: - max: 100 skip-comments: true skip-blank-lines: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#filename-format - name: filename-format severity: warning disabled: false exclude: [""] arguments: - "^[_a-z][_a-z0-9]*\\.go$" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#flag-parameter - name: flag-parameter severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#forbidden-call-in-wg-go - name: forbidden-call-in-wg-go severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#function-length - name: function-length severity: warning disabled: false exclude: [""] arguments: [ 10, 0 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#function-result-limit - name: function-result-limit severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#get-return - name: get-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-branches - name: identical-branches severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-branches - name: identical-ifelseif-branches severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-ifelseif-conditions - name: identical-ifelseif-conditions severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-branches - name: identical-switch-branches severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#identical-switch-conditions - name: identical-switch-conditions severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#if-return - name: if-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#import-alias-naming - name: import-alias-naming severity: warning disabled: false exclude: [""] arguments: - "^[a-z][a-z0-9]{0,}$" # Or this parameter: - allow-regex: "^[a-z][a-z0-9]{0,}$" deny-regex: '^v\d+$' # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#import-shadowing - name: import-shadowing severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#imports-blocklist - name: imports-blocklist severity: warning disabled: false exclude: [""] arguments: - "crypto/md5" - "crypto/sha1" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#increment-decrement - name: increment-decrement severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#indent-error-flow - name: indent-error-flow severity: warning disabled: false exclude: [""] arguments: - "preserve-scope" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#inefficient-map-lookup - name: inefficient-map-lookup severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#line-length-limit - name: line-length-limit severity: warning disabled: false exclude: [""] arguments: [ 80 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-control-nesting - name: max-control-nesting severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-public-structs - name: max-public-structs severity: warning disabled: false exclude: [""] arguments: [ 3 ] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#modifies-parameter - name: modifies-parameter severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#modifies-value-receiver - name: modifies-value-receiver severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#nested-structs - name: nested-structs severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#optimize-operands-order - name: optimize-operands-order severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-comments - name: package-comments severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-directory-mismatch - name: package-directory-mismatch severity: warning disabled: false exclude: [""] arguments: - ignore-directories: ["testcases", "testinfo"] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#package-naming - name: package-naming severity: warning disabled: false exclude: [""] arguments: - skip-convention-name-check: true convention-name-check-regex: "^[a-z][a-zA-Z0-9]*$" skip-top-level-check: true skip-default-bad-name-check: true check-extra-bad-name: true user-defined-bad-names: - foo - bar skip-collision-with-common-std: true check-collision-with-all-std: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range - name: range severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range-val-address - name: range-val-address severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#range-val-in-closure - name: range-val-in-closure severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#receiver-naming - name: receiver-naming severity: warning disabled: false exclude: [""] arguments: - max-length: 2 # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redefines-builtin-id - name: redefines-builtin-id severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-build-tag - name: redundant-build-tag severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-import-alias - name: redundant-import-alias severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#redundant-test-main-exit - name: redundant-test-main-exit severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#string-format - name: string-format severity: warning disabled: false exclude: [""] arguments: - - 'core.WriteError[1].Message' - '/^([^A-Z]|$)/' - must not start with a capital letter - - 'fmt.Errorf[0]' - '/(^|[^\.!?])$/' - must not end in punctuation - - panic - '/^[^\n]*$/' - must not contain line breaks # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#string-of-int - name: string-of-int severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#struct-tag - name: struct-tag severity: warning disabled: false exclude: [""] arguments: - "!validate" - "json,inline" - "bson,outline,gnu" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#superfluous-else - name: superfluous-else severity: warning disabled: false exclude: [""] arguments: - "preserve-scope" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-date - name: time-date severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-equal - name: time-equal severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#time-naming - name: time-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unchecked-type-assertion - name: unchecked-type-assertion severity: warning disabled: false exclude: [""] arguments: - accept-ignored-assertion-result: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unconditional-recursion - name: unconditional-recursion severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unexported-naming - name: unexported-naming severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unexported-return - name: unexported-return severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unhandled-error - name: unhandled-error severity: warning disabled: false exclude: [""] arguments: - "^fmt.Printf" - "myFunction" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-format - name: unnecessary-format severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-if - name: unnecessary-if severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unnecessary-stmt - name: unnecessary-stmt severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unreachable-code - name: unreachable-code severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-slices-sort - name: use-slices-sort severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unsecure-url-scheme - name: unsecure-url-scheme severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-parameter - name: unused-parameter severity: warning disabled: false exclude: [""] arguments: - allow-regex: "^_" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-receiver - name: unused-receiver severity: warning disabled: false exclude: [""] arguments: - allow-regex: "^_" # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-any - name: use-any severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-errors-new - name: use-errors-new severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-fmt-print - name: use-fmt-print severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-slices-sort - name: use-slices-sort severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#use-waitgroup-go - name: use-waitgroup-go severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-break - name: useless-break severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#useless-fallthrough - name: useless-fallthrough severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#var-declaration - name: var-declaration severity: warning disabled: false exclude: [""] # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#var-naming - name: var-naming severity: warning disabled: false exclude: [""] arguments: - [ "ID" ] # AllowList - [ "VM" ] # DenyList - - skip-initialism-name-checks: true upper-case-const: true # https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#waitgroup-by-value - name: waitgroup-by-value severity: warning disabled: false exclude: [""] rowserrcheck: # database/sql is always checked. # Default: [] packages: - github.com/jmoiron/sqlx sloglint: # Enforce not mixing key-value pairs and attributes. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-mixed-arguments # Default: true no-mixed-args: false # Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only). # https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-value-pairs-only # Default: false kv-only: true # Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only). # https://github.com/go-simpler/sloglint?tab=readme-ov-file#attributes-only # Default: false attr-only: true # Enforce not using global loggers. # Values: # - "": disabled # - "all": report all global loggers # - "default": report only the default slog logger # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global # Default: "" no-global: "all" # Enforce using methods that accept a context. # Values: # - "": disabled # - "all": report all contextless calls # - "scope": report only if a context exists in the scope of the outermost function # https://github.com/go-simpler/sloglint?tab=readme-ov-file#context-only # Default: "" context: "all" # Enforce using static values for log messages. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#static-messages # Default: false static-msg: true # Enforce message style. # Values: lowercased, capitalized # https://github.com/go-simpler/sloglint?tab=readme-ov-file#message-style # Default: "" msg-style: capitalized # Enforce using constants instead of raw keys. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-raw-keys # Default: false no-raw-keys: true # Enforce key naming convention. # Values: snake, kebab, camel, pascal # https://github.com/go-simpler/sloglint?tab=readme-ov-file#key-naming-convention # Default: "" key-naming-case: snake # Enforce not using specific keys. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#forbidden-keys # Default: [] forbidden-keys: - time - level - msg - source - foo # Enforce putting arguments on separate lines. # https://github.com/go-simpler/sloglint?tab=readme-ov-file#arguments-on-separate-lines # Default: false args-on-sep-lines: true spancheck: # Checks to enable. # Options include: # - `end`: check that `span.End()` is called # - `record-error`: check that `span.RecordError(err)` is called when an error is returned # - `set-status`: check that `span.SetStatus(codes.Error, msg)` is called when an error is returned # Default: ["end"] checks: - end - record-error - set-status # A list of regexes for function signatures that silence `record-error` and `set-status` reports # if found in the call path to a returned error. # https://github.com/jjti/go-spancheck#ignore-check-signatures # Default: [] ignore-check-signatures: - "telemetry.RecordError" # A list of regexes for additional function signatures that create spans. # This is useful if you have a utility method to create spans. # Each entry should be of the form `:`, where `telemetry-type` can be `opentelemetry` or `opencensus`. # https://github.com/jjti/go-spancheck#extra-start-span-signatures # Default: [] extra-start-span-signatures: - "github.com/user/repo/telemetry/trace.Start:opentelemetry" staticcheck: # https://staticcheck.dev/docs/configuration/options/#dot_import_whitelist # Default: ["github.com/mmcloughlin/avo/build", "github.com/mmcloughlin/avo/operand", "github.com/mmcloughlin/avo/reg"] dot-import-whitelist: - fmt # https://staticcheck.dev/docs/configuration/options/#initialisms # Default: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"] initialisms: [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS" ] # https://staticcheck.dev/docs/configuration/options/#http_status_code_whitelist # Default: ["200", "400", "404", "500"] http-status-code-whitelist: [ "200", "400", "404", "500" ] # SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks # Example (to disable some checks): [ "all", "-SA1000", "-SA1001"] # Run `GL_DEBUG=staticcheck golangci-lint run --enable=staticcheck` to see all available checks and enabled by config checks. # Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"] checks: # Invalid regular expression. # https://staticcheck.dev/docs/checks/#SA1000 - SA1000 # Invalid template. # https://staticcheck.dev/docs/checks/#SA1001 - SA1001 # Invalid format in 'time.Parse'. # https://staticcheck.dev/docs/checks/#SA1002 - SA1002 # Unsupported argument to functions in 'encoding/binary'. # https://staticcheck.dev/docs/checks/#SA1003 - SA1003 # Suspiciously small untyped constant in 'time.Sleep'. # https://staticcheck.dev/docs/checks/#SA1004 - SA1004 # Invalid first argument to 'exec.Command'. # https://staticcheck.dev/docs/checks/#SA1005 - SA1005 # 'Printf' with dynamic first argument and no further arguments. # https://staticcheck.dev/docs/checks/#SA1006 - SA1006 # Invalid URL in 'net/url.Parse'. # https://staticcheck.dev/docs/checks/#SA1007 - SA1007 # Non-canonical key in 'http.Header' map. # https://staticcheck.dev/docs/checks/#SA1008 - SA1008 # '(*regexp.Regexp).FindAll' called with 'n == 0', which will always return zero results. # https://staticcheck.dev/docs/checks/#SA1010 - SA1010 # Various methods in the "strings" package expect valid UTF-8, but invalid input is provided. # https://staticcheck.dev/docs/checks/#SA1011 - SA1011 # A nil 'context.Context' is being passed to a function, consider using 'context.TODO' instead. # https://staticcheck.dev/docs/checks/#SA1012 - SA1012 # 'io.Seeker.Seek' is being called with the whence constant as the first argument, but it should be the second. # https://staticcheck.dev/docs/checks/#SA1013 - SA1013 # Non-pointer value passed to 'Unmarshal' or 'Decode'. # https://staticcheck.dev/docs/checks/#SA1014 - SA1014 # Using 'time.Tick' in a way that will leak. Consider using 'time.NewTicker', and only use 'time.Tick' in tests, commands and endless functions. # https://staticcheck.dev/docs/checks/#SA1015 - SA1015 # Trapping a signal that cannot be trapped. # https://staticcheck.dev/docs/checks/#SA1016 - SA1016 # Channels used with 'os/signal.Notify' should be buffered. # https://staticcheck.dev/docs/checks/#SA1017 - SA1017 # 'strings.Replace' called with 'n == 0', which does nothing. # https://staticcheck.dev/docs/checks/#SA1018 - SA1018 # Using a deprecated function, variable, constant or field. # https://staticcheck.dev/docs/checks/#SA1019 - SA1019 # Using an invalid host:port pair with a 'net.Listen'-related function. # https://staticcheck.dev/docs/checks/#SA1020 - SA1020 # Using 'bytes.Equal' to compare two 'net.IP'. # https://staticcheck.dev/docs/checks/#SA1021 - SA1021 # Modifying the buffer in an 'io.Writer' implementation. # https://staticcheck.dev/docs/checks/#SA1023 - SA1023 # A string cutset contains duplicate characters. # https://staticcheck.dev/docs/checks/#SA1024 - SA1024 # It is not possible to use '(*time.Timer).Reset''s return value correctly. # https://staticcheck.dev/docs/checks/#SA1025 - SA1025 # Cannot marshal channels or functions. # https://staticcheck.dev/docs/checks/#SA1026 - SA1026 # Atomic access to 64-bit variable must be 64-bit aligned. # https://staticcheck.dev/docs/checks/#SA1027 - SA1027 # 'sort.Slice' can only be used on slices. # https://staticcheck.dev/docs/checks/#SA1028 - SA1028 # Inappropriate key in call to 'context.WithValue'. # https://staticcheck.dev/docs/checks/#SA1029 - SA1029 # Invalid argument in call to a 'strconv' function. # https://staticcheck.dev/docs/checks/#SA1030 - SA1030 # Overlapping byte slices passed to an encoder. # https://staticcheck.dev/docs/checks/#SA1031 - SA1031 # Wrong order of arguments to 'errors.Is'. # https://staticcheck.dev/docs/checks/#SA1032 - SA1032 # 'sync.WaitGroup.Add' called inside the goroutine, leading to a race condition. # https://staticcheck.dev/docs/checks/#SA2000 - SA2000 # Empty critical section, did you mean to defer the unlock?. # https://staticcheck.dev/docs/checks/#SA2001 - SA2001 # Called 'testing.T.FailNow' or 'SkipNow' in a goroutine, which isn't allowed. # https://staticcheck.dev/docs/checks/#SA2002 - SA2002 # Deferred 'Lock' right after locking, likely meant to defer 'Unlock' instead. # https://staticcheck.dev/docs/checks/#SA2003 - SA2003 # 'TestMain' doesn't call 'os.Exit', hiding test failures. # https://staticcheck.dev/docs/checks/#SA3000 - SA3000 # Assigning to 'b.N' in benchmarks distorts the results. # https://staticcheck.dev/docs/checks/#SA3001 - SA3001 # Binary operator has identical expressions on both sides. # https://staticcheck.dev/docs/checks/#SA4000 - SA4000 # '&*x' gets simplified to 'x', it does not copy 'x'. # https://staticcheck.dev/docs/checks/#SA4001 - SA4001 # Comparing unsigned values against negative values is pointless. # https://staticcheck.dev/docs/checks/#SA4003 - SA4003 # The loop exits unconditionally after one iteration. # https://staticcheck.dev/docs/checks/#SA4004 - SA4004 # Field assignment that will never be observed. Did you mean to use a pointer receiver?. # https://staticcheck.dev/docs/checks/#SA4005 - SA4005 # A value assigned to a variable is never read before being overwritten. Forgotten error check or dead code?. # https://staticcheck.dev/docs/checks/#SA4006 - SA4006 # The variable in the loop condition never changes, are you incrementing the wrong variable?. # https://staticcheck.dev/docs/checks/#SA4008 - SA4008 # A function argument is overwritten before its first use. # https://staticcheck.dev/docs/checks/#SA4009 - SA4009 # The result of 'append' will never be observed anywhere. # https://staticcheck.dev/docs/checks/#SA4010 - SA4010 # Break statement with no effect. Did you mean to break out of an outer loop?. # https://staticcheck.dev/docs/checks/#SA4011 - SA4011 # Comparing a value against NaN even though no value is equal to NaN. # https://staticcheck.dev/docs/checks/#SA4012 - SA4012 # Negating a boolean twice ('!!b') is the same as writing 'b'. This is either redundant, or a typo. # https://staticcheck.dev/docs/checks/#SA4013 - SA4013 # An if/else if chain has repeated conditions and no side-effects; if the condition didn't match the first time, it won't match the second time, either. # https://staticcheck.dev/docs/checks/#SA4014 - SA4014 # Calling functions like 'math.Ceil' on floats converted from integers doesn't do anything useful. # https://staticcheck.dev/docs/checks/#SA4015 - SA4015 # Certain bitwise operations, such as 'x ^ 0', do not do anything useful. # https://staticcheck.dev/docs/checks/#SA4016 - SA4016 # Discarding the return values of a function without side effects, making the call pointless. # https://staticcheck.dev/docs/checks/#SA4017 - SA4017 # Self-assignment of variables. # https://staticcheck.dev/docs/checks/#SA4018 - SA4018 # Multiple, identical build constraints in the same file. # https://staticcheck.dev/docs/checks/#SA4019 - SA4019 # Unreachable case clause in a type switch. # https://staticcheck.dev/docs/checks/#SA4020 - SA4020 # "x = append(y)" is equivalent to "x = y". # https://staticcheck.dev/docs/checks/#SA4021 - SA4021 # Comparing the address of a variable against nil. # https://staticcheck.dev/docs/checks/#SA4022 - SA4022 # Impossible comparison of interface value with untyped nil. # https://staticcheck.dev/docs/checks/#SA4023 - SA4023 # Checking for impossible return value from a builtin function. # https://staticcheck.dev/docs/checks/#SA4024 - SA4024 # Integer division of literals that results in zero. # https://staticcheck.dev/docs/checks/#SA4025 - SA4025 # Go constants cannot express negative zero. # https://staticcheck.dev/docs/checks/#SA4026 - SA4026 # '(*net/url.URL).Query' returns a copy, modifying it doesn't change the URL. # https://staticcheck.dev/docs/checks/#SA4027 - SA4027 # 'x % 1' is always zero. # https://staticcheck.dev/docs/checks/#SA4028 - SA4028 # Ineffective attempt at sorting slice. # https://staticcheck.dev/docs/checks/#SA4029 - SA4029 # Ineffective attempt at generating random number. # https://staticcheck.dev/docs/checks/#SA4030 - SA4030 # Checking never-nil value against nil. # https://staticcheck.dev/docs/checks/#SA4031 - SA4031 # Comparing 'runtime.GOOS' or 'runtime.GOARCH' against impossible value. # https://staticcheck.dev/docs/checks/#SA4032 - SA4032 # Assignment to nil map. # https://staticcheck.dev/docs/checks/#SA5000 - SA5000 # Deferring 'Close' before checking for a possible error. # https://staticcheck.dev/docs/checks/#SA5001 - SA5001 # The empty for loop ("for {}") spins and can block the scheduler. # https://staticcheck.dev/docs/checks/#SA5002 - SA5002 # Defers in infinite loops will never execute. # https://staticcheck.dev/docs/checks/#SA5003 - SA5003 # "for { select { ..." with an empty default branch spins. # https://staticcheck.dev/docs/checks/#SA5004 - SA5004 # The finalizer references the finalized object, preventing garbage collection. # https://staticcheck.dev/docs/checks/#SA5005 - SA5005 # Infinite recursive call. # https://staticcheck.dev/docs/checks/#SA5007 - SA5007 # Invalid struct tag. # https://staticcheck.dev/docs/checks/#SA5008 - SA5008 # Invalid Printf call. # https://staticcheck.dev/docs/checks/#SA5009 - SA5009 # Impossible type assertion. # https://staticcheck.dev/docs/checks/#SA5010 - SA5010 # Possible nil pointer dereference. # https://staticcheck.dev/docs/checks/#SA5011 - SA5011 # Passing odd-sized slice to function expecting even size. # https://staticcheck.dev/docs/checks/#SA5012 - SA5012 # Using 'regexp.Match' or related in a loop, should use 'regexp.Compile'. # https://staticcheck.dev/docs/checks/#SA6000 - SA6000 # Missing an optimization opportunity when indexing maps by byte slices. # https://staticcheck.dev/docs/checks/#SA6001 - SA6001 # Storing non-pointer values in 'sync.Pool' allocates memory. # https://staticcheck.dev/docs/checks/#SA6002 - SA6002 # Converting a string to a slice of runes before ranging over it. # https://staticcheck.dev/docs/checks/#SA6003 - SA6003 # Inefficient string comparison with 'strings.ToLower' or 'strings.ToUpper'. # https://staticcheck.dev/docs/checks/#SA6005 - SA6005 # Using io.WriteString to write '[]byte'. # https://staticcheck.dev/docs/checks/#SA6006 - SA6006 # Defers in range loops may not run when you expect them to. # https://staticcheck.dev/docs/checks/#SA9001 - SA9001 # Using a non-octal 'os.FileMode' that looks like it was meant to be in octal. # https://staticcheck.dev/docs/checks/#SA9002 - SA9002 # Empty body in an if or else branch. # https://staticcheck.dev/docs/checks/#SA9003 - SA9003 # Only the first constant has an explicit type. # https://staticcheck.dev/docs/checks/#SA9004 - SA9004 # Trying to marshal a struct with no public fields nor custom marshaling. # https://staticcheck.dev/docs/checks/#SA9005 - SA9005 # Dubious bit shifting of a fixed size integer value. # https://staticcheck.dev/docs/checks/#SA9006 - SA9006 # Deleting a directory that shouldn't be deleted. # https://staticcheck.dev/docs/checks/#SA9007 - SA9007 # 'else' branch of a type assertion is probably not reading the right value. # https://staticcheck.dev/docs/checks/#SA9008 - SA9008 # Ineffectual Go compiler directive. # https://staticcheck.dev/docs/checks/#SA9009 - SA9009 # Incorrect or missing package comment. # https://staticcheck.dev/docs/checks/#ST1000 - ST1000 # Dot imports are discouraged. # https://staticcheck.dev/docs/checks/#ST1001 - ST1001 # Poorly chosen identifier. # https://staticcheck.dev/docs/checks/#ST1003 - ST1003 # Incorrectly formatted error string. # https://staticcheck.dev/docs/checks/#ST1005 - ST1005 # Poorly chosen receiver name. # https://staticcheck.dev/docs/checks/#ST1006 - ST1006 # A function's error value should be its last return value. # https://staticcheck.dev/docs/checks/#ST1008 - ST1008 # Poorly chosen name for variable of type 'time.Duration'. # https://staticcheck.dev/docs/checks/#ST1011 - ST1011 # Poorly chosen name for error variable. # https://staticcheck.dev/docs/checks/#ST1012 - ST1012 # Should use constants for HTTP error codes, not magic numbers. # https://staticcheck.dev/docs/checks/#ST1013 - ST1013 # A switch's default case should be the first or last case. # https://staticcheck.dev/docs/checks/#ST1015 - ST1015 # Use consistent method receiver names. # https://staticcheck.dev/docs/checks/#ST1016 - ST1016 # Don't use Yoda conditions. # https://staticcheck.dev/docs/checks/#ST1017 - ST1017 # Avoid zero-width and control characters in string literals. # https://staticcheck.dev/docs/checks/#ST1018 - ST1018 # Importing the same package multiple times. # https://staticcheck.dev/docs/checks/#ST1019 - ST1019 # The documentation of an exported function should start with the function's name. # https://staticcheck.dev/docs/checks/#ST1020 - ST1020 # The documentation of an exported type should start with type's name. # https://staticcheck.dev/docs/checks/#ST1021 - ST1021 # The documentation of an exported variable or constant should start with variable's name. # https://staticcheck.dev/docs/checks/#ST1022 - ST1022 # Redundant type in variable declaration. # https://staticcheck.dev/docs/checks/#ST1023 - ST1023 # Use plain channel send or receive instead of single-case select. # https://staticcheck.dev/docs/checks/#S1000 - S1000 # Replace for loop with call to copy. # https://staticcheck.dev/docs/checks/#S1001 - S1001 # Omit comparison with boolean constant. # https://staticcheck.dev/docs/checks/#S1002 - S1002 # Replace call to 'strings.Index' with 'strings.Contains'. # https://staticcheck.dev/docs/checks/#S1003 - S1003 # Replace call to 'bytes.Compare' with 'bytes.Equal'. # https://staticcheck.dev/docs/checks/#S1004 - S1004 # Drop unnecessary use of the blank identifier. # https://staticcheck.dev/docs/checks/#S1005 - S1005 # Use "for { ... }" for infinite loops. # https://staticcheck.dev/docs/checks/#S1006 - S1006 # Simplify regular expression by using raw string literal. # https://staticcheck.dev/docs/checks/#S1007 - S1007 # Simplify returning boolean expression. # https://staticcheck.dev/docs/checks/#S1008 - S1008 # Omit redundant nil check on slices, maps, and channels. # https://staticcheck.dev/docs/checks/#S1009 - S1009 # Omit default slice index. # https://staticcheck.dev/docs/checks/#S1010 - S1010 # Use a single 'append' to concatenate two slices. # https://staticcheck.dev/docs/checks/#S1011 - S1011 # Replace 'time.Now().Sub(x)' with 'time.Since(x)'. # https://staticcheck.dev/docs/checks/#S1012 - S1012 # Use a type conversion instead of manually copying struct fields. # https://staticcheck.dev/docs/checks/#S1016 - S1016 # Replace manual trimming with 'strings.TrimPrefix'. # https://staticcheck.dev/docs/checks/#S1017 - S1017 # Use "copy" for sliding elements. # https://staticcheck.dev/docs/checks/#S1018 - S1018 # Simplify "make" call by omitting redundant arguments. # https://staticcheck.dev/docs/checks/#S1019 - S1019 # Omit redundant nil check in type assertion. # https://staticcheck.dev/docs/checks/#S1020 - S1020 # Merge variable declaration and assignment. # https://staticcheck.dev/docs/checks/#S1021 - S1021 # Omit redundant control flow. # https://staticcheck.dev/docs/checks/#S1023 - S1023 # Replace 'x.Sub(time.Now())' with 'time.Until(x)'. # https://staticcheck.dev/docs/checks/#S1024 - S1024 # Don't use 'fmt.Sprintf("%s", x)' unnecessarily. # https://staticcheck.dev/docs/checks/#S1025 - S1025 # Simplify error construction with 'fmt.Errorf'. # https://staticcheck.dev/docs/checks/#S1028 - S1028 # Range over the string directly. # https://staticcheck.dev/docs/checks/#S1029 - S1029 # Use 'bytes.Buffer.String' or 'bytes.Buffer.Bytes'. # https://staticcheck.dev/docs/checks/#S1030 - S1030 # Omit redundant nil check around loop. # https://staticcheck.dev/docs/checks/#S1031 - S1031 # Use 'sort.Ints(x)', 'sort.Float64s(x)', and 'sort.Strings(x)'. # https://staticcheck.dev/docs/checks/#S1032 - S1032 # Unnecessary guard around call to "delete". # https://staticcheck.dev/docs/checks/#S1033 - S1033 # Use result of type assertion to simplify cases. # https://staticcheck.dev/docs/checks/#S1034 - S1034 # Redundant call to 'net/http.CanonicalHeaderKey' in method call on 'net/http.Header'. # https://staticcheck.dev/docs/checks/#S1035 - S1035 # Unnecessary guard around map access. # https://staticcheck.dev/docs/checks/#S1036 - S1036 # Elaborate way of sleeping. # https://staticcheck.dev/docs/checks/#S1037 - S1037 # Unnecessarily complex way of printing formatted string. # https://staticcheck.dev/docs/checks/#S1038 - S1038 # Unnecessary use of 'fmt.Sprint'. # https://staticcheck.dev/docs/checks/#S1039 - S1039 # Type assertion to current type. # https://staticcheck.dev/docs/checks/#S1040 - S1040 # Apply De Morgan's law. # https://staticcheck.dev/docs/checks/#QF1001 - QF1001 # Convert untagged switch to tagged switch. # https://staticcheck.dev/docs/checks/#QF1002 - QF1002 # Convert if/else-if chain to tagged switch. # https://staticcheck.dev/docs/checks/#QF1003 - QF1003 # Use 'strings.ReplaceAll' instead of 'strings.Replace' with 'n == -1'. # https://staticcheck.dev/docs/checks/#QF1004 - QF1004 # Expand call to 'math.Pow'. # https://staticcheck.dev/docs/checks/#QF1005 - QF1005 # Lift 'if'+'break' into loop condition. # https://staticcheck.dev/docs/checks/#QF1006 - QF1006 # Merge conditional assignment into variable declaration. # https://staticcheck.dev/docs/checks/#QF1007 - QF1007 # Omit embedded fields from selector expression. # https://staticcheck.dev/docs/checks/#QF1008 - QF1008 # Use 'time.Time.Equal' instead of '==' operator. # https://staticcheck.dev/docs/checks/#QF1009 - QF1009 # Convert slice of bytes to string when printing it. # https://staticcheck.dev/docs/checks/#QF1010 - QF1010 # Omit redundant type from variable declaration. # https://staticcheck.dev/docs/checks/#QF1011 - QF1011 # Use 'fmt.Fprintf(x, ...)' instead of 'x.Write(fmt.Sprintf(...))'. # https://staticcheck.dev/docs/checks/#QF1012 - QF1012 tagalign: # Align and sort can be used together or separately. # # Whether enable align. If true, the struct tags will be aligned. # E.g.: # type FooBar struct { # Bar string `json:"bar" validate:"required"` # FooFoo int8 `json:"foo_foo" validate:"required"` # } # will be formatted to: # type FooBar struct { # Bar string `json:"bar" validate:"required"` # FooFoo int8 `json:"foo_foo" validate:"required"` # } # Default: true. align: false # Whether enable tags sort. # If true, the tags will be sorted by name in ascending order. # E.g.: `xml:"bar" json:"bar" validate:"required"` -> `json:"bar" validate:"required" xml:"bar"`. # Default: true sort: false # Specify the order of tags, the other tags will be sorted by name. # This option will be ignored if `sort` is false. # Default: [] order: - json - yaml - yml - toml - mapstructure - binding - validate # Whether enable strict style. # In this style, the tags will be sorted and aligned in the dictionary order, # and the tags with the same name will be aligned together. # Note: This option will be ignored if 'align' or 'sort' is false. # Default: false strict: true tagliatelle: # Checks the struct tag name case. case: # Defines the association between tag name and case. # Any struct tag name can be used. # Supported string cases: # - `camel` # - `pascal` # - `kebab` # - `snake` # - `upperSnake` # - `goCamel` # - `goPascal` # - `goKebab` # - `goSnake` # - `upper` # - `lower` # - `header` rules: json: camel yaml: camel xml: camel toml: camel bson: camel avro: snake mapstructure: kebab env: upperSnake envconfig: upperSnake whatever: snake # Defines the association between tag name and case. # Important: the `extended-rules` overrides `rules`. # Default: empty extended-rules: json: # Supported string cases: # - `camel` # - `pascal` # - `kebab` # - `snake` # - `upperSnake` # - `goCamel` # - `goPascal` # - `goKebab` # - `goSnake` # - `header` # - `lower` # - `header` # # Required case: camel # Adds 'AMQP', 'DB', 'GID', 'RTP', 'SIP', 'TS' to initialisms, # and removes 'LHS', 'RHS' from initialisms. # Default: false extra-initialisms: true # Defines initialism additions and overrides. # Default: empty initialism-overrides: DB: true # add a new initialism LHS: false # disable a default initialism. # ... # Uses the struct field name to check the name of the struct tag. # Default: false use-field-name: true # The field names to ignore. # Default: [] ignored-fields: - Bar - Foo # Overrides the default/root configuration. # Default: [] overrides: - # The package path (uses `/` only as a separator). # Required pkg: foo/bar # Default: empty or the same as the default/root configuration. rules: json: snake xml: pascal # Default: empty or the same as the default/root configuration. extended-rules: # Same options as the base `extended-rules`. # Default: false (WARNING: it doesn't follow the default/root configuration) use-field-name: true # The field names to ignore. # Default: [] or the same as the default/root configuration. ignored-fields: - Bar - Foo # Ignore the package (takes precedence over all other configurations). # Default: false ignore: true testifylint: # Enable all checkers (https://github.com/Antonboom/testifylint#checkers). # Default: false enable-all: true # Disable checkers by name # (in addition to default # suite-thelper # ). disable: - blank-import - bool-compare - compares - contains - empty - encoded-compare - equal-values - error-is-as - error-nil - expected-actual - float-compare - formatter - go-require - len - negative-positive - nil-compare - regexp - require-error - suite-broken-parallel - suite-dont-use-pkg - suite-extra-assert-call - suite-method-signature - suite-subtest-run - suite-thelper - useless-assert # Disable all checkers (https://github.com/Antonboom/testifylint#checkers). # Default: false disable-all: true # Enable checkers by name # (in addition to default # blank-import, bool-compare, compares, contains, empty, encoded-compare, equal-values, error-is-as, error-nil, # expected-actual, go-require, float-compare, formatter, len, negative-positive, nil-compare, regexp, require-error, # suite-broken-parallel, suite-dont-use-pkg, suite-extra-assert-call, suite-subtest-run, suite-method-signature, # useless-assert # ). enable: - blank-import - bool-compare - compares - contains - empty - encoded-compare - equal-values - error-is-as - error-nil - expected-actual - float-compare - formatter - go-require - len - negative-positive - nil-compare - regexp - require-error - suite-broken-parallel - suite-dont-use-pkg - suite-extra-assert-call - suite-method-signature - suite-subtest-run - suite-thelper - useless-assert bool-compare: # To ignore user defined types (over builtin bool). # Default: false ignore-custom-types: true expected-actual: # Regexp for expected variable name. # Default: (^(exp(ected)?|want(ed)?)([A-Z]\w*)?$)|(^(\w*[a-z])?(Exp(ected)?|Want(ed)?)$) pattern: ^expected formatter: # To enable go vet's printf checks. # Default: true check-format-string: false # To require f-assertions (e.g. `assert.Equalf`) if format string is used, even if there are no variable-length # variables, i.e. it requires `require.NoErrorf` for both these cases: # - require.NoErrorf(t, err, "unexpected error") # - require.NoErrorf(t, err, "unexpected error for sid: %v", sid) # To understand this behavior, please read the # https://github.com/Antonboom/testifylint?tab=readme-ov-file#historical-reference-of-formatter. # Default: false require-f-funcs: true # To require that the first element of msgAndArgs (msg) has a string type. # For example, in such case assertion like `assert.True(t, b, tt.case)` will be considered as invalid. # Default: true require-string-msg: false go-require: # To ignore HTTP handlers (like http.HandlerFunc). # Default: false ignore-http-handlers: true require-error: # Regexp for assertions to analyze. If defined, then only matched error assertions will be reported. # Default: "" fn-pattern: ^(Errorf?|NoErrorf?)$ suite-extra-assert-call: # To require or remove extra Assert() call? # Default: remove mode: require testpackage: # Regexp pattern to skip files. # Default: "(export|internal)_test\\.go" skip-regexp: (export|internal)_test\.go # List of packages that don't end with _test that tests are allowed to be in. # Default: "main" allow-packages: - example - main thelper: test: # Check *testing.T is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.T param has name t. # Default: true name: false # Check t.Helper() begins helper function. # Default: true begin: false benchmark: # Check *testing.B is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.B param has name b. # Default: true name: false # Check b.Helper() begins helper function. # Default: true begin: false tb: # Check *testing.TB is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.TB param has name tb. # Default: true name: false # Check tb.Helper() begins helper function. # Default: true begin: false fuzz: # Check *testing.F is first param (or after context.Context) of helper function. # Default: true first: false # Check *testing.F param has name f. # Default: true name: false # Check f.Helper() begins helper function. # Default: true begin: false usestdlibvars: # Suggest the use of http.MethodXX. # Default: true http-method: false # Suggest the use of http.StatusXX. # Default: true http-status-code: false # Suggest the use of time.Month in time.Date. # Default: false time-date-month: true # Suggest the use of time.Weekday.String(). # Default: true time-weekday: true # Suggest the use of time.Month.String(). # Default: false time-month: true # Suggest the use of time.Layout. # Default: false time-layout: true # Suggest the use of crypto.Hash.String(). # Default: false crypto-hash: true # Suggest the use of rpc.DefaultXXPath. # Default: false default-rpc-path: true # Suggest the use of sql.LevelXX.String(). # Default: false sql-isolation-level: true # Suggest the use of tls.SignatureScheme.String(). # Default: false tls-signature-scheme: true # Suggest the use of constant.Kind.String(). # Default: false constant-kind: true usetesting: # Enable/disable `os.CreateTemp("", ...)` detections. # Default: true os-create-temp: false # Enable/disable `os.MkdirTemp()` detections. # Default: true os-mkdir-temp: false # Enable/disable `os.Setenv()` detections. # Default: true os-setenv: false # Enable/disable `os.TempDir()` detections. # Default: false os-temp-dir: true # Enable/disable `os.Chdir()` detections. # Disabled if Go < 1.24. # Default: true os-chdir: false # Enable/disable `context.Background()` detections. # Disabled if Go < 1.24. # Default: false context-background: true # Enable/disable `context.TODO()` detections. # Disabled if Go < 1.24. # Default: false context-todo: true unconvert: # Remove conversions that force intermediate rounding. # Default: false fast-math: true # Be more conservative (experimental). # Default: false safe: true unparam: # Inspect exported functions. # Set to true if no external program/library imports your code. # # IMPORTANT: If you enable this setting, unparam reports many false positives in text editors: # when run on a subdirectory it cannot find external interfaces. # Most editor integrations invoke golangci-lint on the directory containing the changed file. # # Default: false check-exported: true unqueryvet: # Enable SQL builder checking. # Default: true check-sql-builders: false # Enable aliased wildcard detection like `SELECT t.*`. # Default: true check-aliased-wildcard: false # Enable string concatenation analysis. # Default: true check-string-concat: false # Enable format string analysis like `fmt.Sprintf`. # Default: true check-format-strings: false # Enable strings.Builder analysis. # Default: true check-string-builder: false # Enable subquery analysis. # Default: true check-subqueries: false # Detects N+1 Query. # Default: false check-n1: true # Detects SQL injection. # Default: false check-sql-injection: true # Detects transaction leaks. # Default: false check-tx-leaks: true # Regex patterns for acceptable `SELECT *` usage. # Default: # - "SELECT \\* FROM information_schema\\..*" # - "SELECT \\* FROM pg_catalog\\..*" # - "SELECT COUNT\\(\\*\\)" # - "SELECT MAX\\(\\*\\)" # - "SELECT MIN\\(\\*\\)" allowed-patterns: - "SELECT \\* FROM temp_.*" - "SELECT \\* FROM.*-- migration" # Allow is a list of SQL patterns to allow (whitelist). # Default: [] allow: - foo # Functions to ignore (regex patterns) # Default: [] ignored-functions: - "debug\\..*" - "test.*" # SQL builder libraries to check. # Default: all true. sql-builders: squirrel: false gorm: false sqlx: false ent: false pgx: false bun: false sqlboiler: false jet: false # List of user-defined DSL rules. # https://github.com/MirrexOne/unqueryvet?tab=readme-ov-file#custom-rules-dsl # Default: [] custom-rules: - id: allow-temp-tables pattern: "SELECT * FROM $TABLE" when: "isTempTable(table)" action: allow - id: dangerous-delete pattern: "DELETE FROM $TABLE" when: "!has_where" message: "DELETE without WHERE clause" unused: # Mark all struct fields that have been written to as used. # Default: true field-writes-are-uses: false # Treat IncDec statement (e.g. `i++` or `i--`) as both read and write operation instead of just write. # Default: false post-statements-are-reads: true # Mark all exported fields as used. # default: true exported-fields-are-used: false # Mark all function parameters as used. # default: true parameters-are-used: false # Mark all local variables as used. # default: true local-variables-are-used: false # Mark all identifiers inside generated files as used. # Default: true generated-is-used: false varnamelen: # The longest distance, in source lines, that is being considered a "small scope". # Variables used in at most this many lines will be ignored. # Default: 5 max-distance: 6 # The minimum length of a variable's name that is considered "long". # Variable names that are at least this long will be ignored. # Default: 3 min-name-length: 2 # Check method receivers. # Default: false check-receiver: true # Check named return values. # Default: false check-return: true # Check type parameters. # Default: false check-type-param: true # Ignore "ok" variables that hold the bool return value of a type assertion. # Default: false ignore-type-assert-ok: true # Ignore "ok" variables that hold the bool return value of a map index. # Default: false ignore-map-index-ok: true # Ignore "ok" variables that hold the bool return value of a channel receive. # Default: false ignore-chan-recv-ok: true # Optional list of variable names that should be ignored completely. # Default: [] ignore-names: - err # Optional list of variable declarations that should be ignored completely. # Entries must be in one of the following forms (see below for examples): # - for variables, parameters, named return values, method receivers, or type parameters: # ( can also be a pointer/slice/map/chan/...) # - for constants: const # # Default: [] ignore-decls: - c echo.Context - t testing.T - f *foo.Bar - e error - i int - const C - T any - m map[string]int whitespace: # Enforces newlines (or comments) after every multi-line if statement. # Default: false multi-if: true # Enforces newlines (or comments) after every multi-line function signature. # Default: false multi-func: true wrapcheck: # An array of strings specifying additional substrings of signatures to ignore. # Unlike 'ignore-sigs', this option extends the default set (or the set specified in 'ignore-sigs') without replacing it entirely. # This allows you to add specific signatures to the ignore list # while retaining the defaults or any items in 'ignore-sigs'. # Default: [] extra-ignore-sigs: - .CustomError( - .SpecificWrap( # An array of strings that specify substrings of signatures to ignore. # If this set, it will override the default set of ignored signatures. # See https://github.com/tomarrell/wrapcheck#configuration for more information. # Default: [".Errorf(", "errors.New(", "errors.Unwrap(", "errors.Join(", ".Wrap(", ".Wrapf(", ".WithMessage(", ".WithMessagef(", ".WithStack("] ignore-sigs: - .Errorf( - errors.New( - errors.Unwrap( - errors.Join( - .Wrap( - .Wrapf( - .WithMessage( - .WithMessagef( - .WithStack( # An array of strings that specify regular expressions of signatures to ignore. # Default: [] ignore-sig-regexps: - \.New.*Error\( # An array of strings that specify globs of packages to ignore. # Default: [] ignore-package-globs: - encoding/* - github.com/pkg/* # An array of strings that specify regular expressions of interfaces to ignore. # Default: [] ignore-interface-regexps: - ^(?i)c(?-i)ach(ing|e) # Determines whether wrapcheck should report errors returned from inside the package. # Default: false report-internal-errors: true wsl: # Do strict checking when assigning from append (x = append(x, y)). # If this is set to true - the append call must append either a variable # assigned, called or used on the line above. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#strict-append # Default: true strict-append: false # Allows assignments to be cuddled with variables used in calls on # line above and calls to be cuddled with assignments of variables # used in call on line above. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-assign-and-call # Default: true allow-assign-and-call: false # Allows assignments to be cuddled with anything. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-assign-and-anything # Default: false allow-assign-and-anything: true # Allows cuddling to assignments even if they span over multiple lines. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-multiline-assign # Default: true allow-multiline-assign: false # If the number of lines in a case block is equal to or lager than this number, # the case *must* end white a newline. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#force-case-trailing-whitespace # Default: 0 force-case-trailing-whitespace: 1 # Allow blocks to end with comments. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-trailing-comment # Default: false allow-trailing-comment: true # Allow multiple comments in the beginning of a block separated with newline. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-separated-leading-comment # Default: false allow-separated-leading-comment: true # Allow multiple var/declaration statements to be cuddled. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-cuddle-declarations # Default: false allow-cuddle-declarations: true # A list of call idents that everything can be cuddled with. # Defaults: [ "Lock", "RLock" ] allow-cuddle-with-calls: [ "Foo", "Bar" ] # AllowCuddleWithRHS is a list of right hand side variables that is allowed # to be cuddled with anything. # Defaults: [ "Unlock", "RUnlock" ] allow-cuddle-with-rhs: [ "Foo", "Bar" ] # Allow cuddling with any block as long as the variable is used somewhere in # the block. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#allow-cuddle-used-in-block # Default: false allow-cuddle-used-in-block: true # Causes an error when an If statement that checks an error variable doesn't # cuddle with the assignment of that variable. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#force-err-cuddling # Default: false force-err-cuddling: true # When force-err-cuddling is enabled this is a list of names # used for error variables to check for in the conditional. # Default: [ "err" ] error-variable-names: [ "foo" ] # Causes an error if a short declaration (:=) cuddles with anything other than # another short declaration. # This logic overrides force-err-cuddling among others. # https://github.com/bombsimon/wsl/blob/HEAD/doc/configuration.md#force-short-decl-cuddling # Default: false force-short-decl-cuddling: true wsl_v5: # Allow cuddling a variable if it's used first in the immediate following block, # even if the statement with the block doesn't use the variable. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: true allow-first-in-block: false # Same as above, # but allows cuddling if the variable is used anywhere in the following (or nested) block. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: false allow-whole-block: true # If a block contains more than this number of lines, # the branch statement needs to be separated by whitespace. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: 2 branch-max-lines: 4 # If set to a non-negative number, # case blocks need to end with whitespace if exceeding this number # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#configuration # Default: 0 case-max-lines: 2 # Default checks to use. # Can be `all`, `none`, `default` or empty. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration # Default: "" default: all # Enabled checks. # Will be additive to any presets. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration # Default: [] enable: - assign - branch - decl - defer - expr - for - go - if - inc-dec - label - range - return - select - send - switch - type-switch - append - assign-exclusive - assign-expr - err - leading-whitespace - trailing-whitespace - after-block # Disable checks. # Will be subtractive to any preset. # https://github.com/bombsimon/wsl/tree/main?tab=readme-ov-file#checks-and-configuration # Default: [] disable: - assign - branch - decl - defer - expr - for - go - if - inc-dec - label - range - return - select - send - switch - type-switch - append - assign-exclusive - assign-expr - err - leading-whitespace - trailing-whitespace - after-block # The custom section can be used to define linter plugins to be loaded at runtime. # See README documentation for more info. custom: # Each custom linter should have a unique name. example: # The plugin type. # It can be `goplugin` or `module`. # Default: goplugin type: module # The path to the plugin *.so. Can be absolute or local. # Required for each custom linter. path: /path/to/example.so # The description of the linter. # Optional. description: This is an example usage of a plugin linter. # Intended to point to the repo location of the linter. # Optional. original-url: github.com/golangci/example-linter # Plugins settings/configuration. # Only work with plugin based on `linterdb.PluginConstructor`. # Optional. settings: foo: bar # Defines a set of rules to ignore issues. # It does not skip the analysis, and so does not ignore "typecheck" errors. exclusions: # Mode of the generated files analysis. # # - `strict`: sources are excluded by strictly following the Go generated file convention. # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$` # This line must appear before the first non-comment, non-blank text in the file. # https://go.dev/s/generatedcode # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc. # - `disable`: disable the generated files exclusion. # # Default: strict generated: lax # Log a warning if an exclusion rule is unused. # Default: false warn-unused: true # Predefined exclusion rules. # Default: [] presets: - comments - std-error-handling - common-false-positives - legacy # Excluding configuration per-path, per-linter, per-text and per-source. rules: # Exclude some linters from running on tests files. - path: _test\.go linters: - gocyclo - errcheck - dupl - gosec # Run some linter only for test files by excluding its issues for everything else. - path-except: _test\.go linters: - forbidigo # Exclude known linters from partially hard-vendored code, # which is impossible to exclude via `nolint` comments. # `/` will be replaced by the current OS file path separator to properly work on Windows. - path: internal/hmac/ text: "weak cryptographic primitive" linters: - gosec # Exclude some `staticcheck` messages. - linters: - staticcheck text: "SA9003:" # Exclude `lll` issues for long lines with `go:generate`. - linters: - lll source: "^//go:generate " # Which file paths to exclude: they will be analyzed, but issues from them won't be reported. # "/" will be replaced by the current OS file path separator to properly work on Windows. # Default: [] paths: - ".*\\.my\\.go$" - lib/bad.go # Which file paths to not exclude. # Default: [] paths-except: - ".*\\.my\\.go$" - lib/bad.go formatters: # Enable specific formatter. # Default: [] (uses standard Go formatting) enable: - gci - gofmt - gofumpt - goimports - golines - swaggo # Formatters settings. settings: gci: # Section configuration to compare against. # Section names are case-insensitive and may contain parameters in (). # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`. # If `custom-order` is `true`, it follows the order of `sections` option. # Default: ["standard", "default"] sections: - standard # Standard section: captures all standard packages. - default # Default section: contains all imports that could not be matched to another section type. - prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix. - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled. - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled. # Checks that no inline comments are present. # Default: false no-inline-comments: true # Checks that no prefix comments (comment lines above an import) are present. # Default: false no-prefix-comments: true # Enable custom order of sections. # If `true`, make the section order the same as the order of `sections`. # Default: false custom-order: true # Drops lexical ordering for custom sections. # Default: false no-lex-order: true gofmt: # Simplify code: gofmt with `-s` option. # Default: true simplify: false # Apply the rewrite rules to the source before reformatting. # https://pkg.go.dev/cmd/gofmt # Default: [] rewrite-rules: - pattern: 'interface{}' replacement: 'any' - pattern: 'a[b:len(a)]' replacement: 'a[b:]' gofumpt: # Module path which contains the source code being formatted. # Default: "" module-path: github.com/org/project # Choose whether to use the extra rules. # Default: false extra-rules: true goimports: # A list of prefixes, which, if set, checks import paths # with the given prefixes are grouped after 3rd-party packages. # Default: [] local-prefixes: - github.com/org/project golines: # Target maximum line length. # Default: 100 max-len: 200 # Length of a tabulation. # Default: 4 tab-len: 8 # Shorten single-line comments. # Default: false shorten-comments: true # Default: true reformat-tags: false # Split chained methods on the dots as opposed to the arguments. # Default: true chain-split-dots: false exclusions: # Log a warning if an exclusion path is unused. # Default: false warn-unused: true # Mode of the generated files analysis. # # - `strict`: sources are excluded by strictly following the Go generated file convention. # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$` # This line must appear before the first non-comment, non-blank text in the file. # https://go.dev/s/generatedcode # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc. # - `disable`: disable the generated files exclusion. # # Default: lax generated: strict # Which file paths to exclude. # This option is ignored when using `--stdin` as the path is unknown. # Default: [] paths: - ".*\\.my\\.go$" - lib/bad.go issues: # Maximum issues count per one linter. # Set to 0 to disable. # Default: 50 max-issues-per-linter: 0 # Maximum count of issues with the same text. # Set to 0 to disable. # Default: 3 max-same-issues: 0 # Make issues output unique by line. # Default: true uniq-by-line: false # Show only new issues: if there are unstaged changes or untracked files, # only those changes are analyzed, else only changes in HEAD~ are analyzed. # It's a super-useful option for integration of golangci-lint into existing large codebase. # It's not practical to fix all existing issues at the moment of integration: # much better don't allow issues in new code. # # Default: false new: true # Show only new issues created after the best common ancestor (merge-base against HEAD). # Default: "" new-from-merge-base: main # Show only new issues created after git revision `REV`. # Default: "" new-from-rev: HEAD # Show only new issues created in git patch with set file path. # Default: "" new-from-patch: path/to/patch/file # Show issues in any part of update files (requires new-from-rev or new-from-patch). # Default: false whole-files: true # Apply the fixes detected by the linters and formatters (if it's supported by the linter). # Default: false fix: true # Output configuration options. output: # The formats used to render issues. formats: # Prints issues in a text format with colors, line number, and linter name. # This format is the default format. text: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.txt # Print linter name in the end of issue text. # Default: true print-linter-name: false # Print lines of code with issue. # Default: true print-issued-lines: false # Use colors. # Default: true colors: false # Prints issues in a JSON representation. json: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.json # Prints issues in columns representation separated by tabulations. tab: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.txt # Print linter name in the end of issue text. # Default: true print-linter-name: true # Use colors. # Default: true colors: false # Prints issues in an HTML page. # It uses the Cloudflare CDN (cdnjs) and React. html: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.html # Prints issues in the Checkstyle format. checkstyle: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.xml # Prints issues in the Code Climate format. code-climate: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.json # Prints issues in the JUnit XML format. junit-xml: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.xml # Support extra JUnit XML fields. # Default: false extended: true # Prints issues in the TeamCity format. teamcity: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.txt # Prints issues in the SARIF format. sarif: # Output path can be either `stdout`, `stderr` or path to the file to write to. # Default: stdout path: ./path/to/output.json # Add a prefix to the output file references. # This option is ignored when using `output.path-mode: abs` mode. # Default: "" path-prefix: "" # By default, the report are related to the path obtained by `run.relative-path-mode`. # The mode `abs` allows to show absolute file paths instead of relative file paths. # The option `output.path-prefix` is ignored when using `abs` mode. # Default: "" path-mode: "abs" # Order to use when sorting results. # Possible values: `file`, `linter`, and `severity`. # # If the severity values are inside the following list, they are ordered in this order: # 1. error # 2. warning # 3. high # 4. medium # 5. low # Either they are sorted alphabetically. # # Default: ["linter", "file"] sort-order: - linter - severity - file # filepath, line, and column. # Show statistics per linter. # Default: true show-stats: false # Options for analysis running. run: # Timeout for total work, e.g. 30s, 5m, 5m30s. # If the value is lower or equal to 0, the timeout is disabled. # Default: 0 (disabled) timeout: 5m # The mode used to evaluate relative paths. # It's used by exclusions, Go plugins, and some linters. # The value can be: # - `gomod`: the paths will be relative to the directory of the `go.mod` file. # - `gitroot`: the paths will be relative to the git root (the parent directory of `.git`). # - `cfg`: the paths will be relative to the configuration file. # - `wd` (NOT recommended): the paths will be relative to the place where golangci-lint is run. # Default: cfg relative-path-mode: gomod # Exit code when at least one issue was found. # Default: 1 issues-exit-code: 2 # Include test files or not. # Default: true tests: false # List of build tags, all linters use it. # Default: [] build-tags: - mytag # 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. # # Allowed values: readonly|vendor|mod # Default: "" modules-download-mode: readonly # Uses version control information during the loading of packages. # Default: false (implies `-buildvcs=false`) enable-build-vcs: true # Allow multiple parallel golangci-lint instances running. # If false, golangci-lint acquires file lock on start. # Default: false allow-parallel-runners: true # Allow multiple golangci-lint instances running, but serialize them around a lock. # If false, golangci-lint exits with an error if it fails to acquire file lock on start. # Default: false allow-serial-runners: true # Define the Go version limit. # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.22. go: '1.23' # Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously. # Default: 0 (automatically set to match Linux container CPU quota and # fall back to the number of logical CPUs in the machine) concurrency: 4 severity: # Set the default severity for issues. # # If severity rules are defined and the issues do not match or no severity is provided to the rule # this will be the default severity applied. # Severities should match the supported severity names of the selected out format. # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message # - TeamCity: https://www.jetbrains.com/help/teamcity/service-messages.html#Inspection+Instance # # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...) # # Default: "" default: error # When a list of severity rules are provided, severity information will be added to lint issues. # Severity rules have the same filtering capability as exclude rules # except you are allowed to specify one matcher per severity rule. # # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...) # # Only affects out formats that support setting severity information. # # Default: [] rules: - linters: - dupl severity: info ================================================ FILE: .golangci.yml ================================================ # This configuration file is not a recommendation. # # We intentionally use a limited set of linters. # This configuration file is used with different version of golangci-lint to avoid regressions: # the linters can change between version, # their configuration may be not compatible or their reports can be different, # and this can break some of our tests. # Also, some linters are not relevant for the project (e.g. linters related to SQL). # # We have specific constraints, so we use a specific configuration. # # See the file `.golangci.reference.yml` to have a list of all available configuration options. version: "2" linters: default: none # This list of linters is not a recommendation (same thing for all this configuration file). # We intentionally use a limited set of linters. # See the comment on top of this file. enable: - bodyclose - copyloopvar - depguard - dogsled - dupl - errcheck - errorlint - funlen - gocheckcompilerdirectives - gochecknoinits - goconst - gocritic - gocyclo - godox - mnd - goprintffuncname - gosec - govet - intrange - ineffassign - lll - misspell - nakedret - noctx - nolintlint - revive - staticcheck - testifylint - unconvert - unparam - unused - whitespace settings: depguard: rules: logger: deny: # logging is allowed only by logutils.Log, - pkg: "github.com/sirupsen/logrus" desc: logging is allowed only by logutils.Log. - pkg: "github.com/pkg/errors" desc: Should be replaced by standard lib errors package. - pkg: "github.com/instana/testify" desc: It's a fork of github.com/stretchr/testify. files: # logrus is allowed to use only in logutils package. - "!**/pkg/logutils/**.go" dupl: threshold: 100 funlen: lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner. statements: 50 goconst: min-len: 2 min-occurrences: 3 gocritic: enabled-tags: - diagnostic - experimental - opinionated - performance - style disabled-checks: - dupImport # https://github.com/go-critic/go-critic/issues/845 - ifElseChain - octalLiteral - whyNoLint gocyclo: min-complexity: 15 godox: keywords: - FIXME mnd: # don't include the "operation" and "assign" checks: - argument - case - condition - return ignored-numbers: - '0' - '1' - '2' - '3' ignored-functions: - strings.SplitN govet: settings: printf: funcs: - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Infof - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Warnf - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Errorf - (github.com/golangci/golangci-lint/v2/pkg/logutils.Log).Fatalf enable: - nilness - shadow errorlint: asserts: false lll: line-length: 140 misspell: locale: US ignore-rules: - "importas" # linter name nolintlint: allow-unused: false # report any unused nolint directives require-explanation: true # require an explanation for nolint directives require-specific: true # require nolint directives to be specific about which linter is being skipped revive: rules: - name: indent-error-flow - name: unexported-return disabled: true - name: unused-parameter - name: unused-receiver exclusions: presets: - comments - std-error-handling - common-false-positives - legacy paths: - test/testdata_etc # test files - internal/go # extracted from Go code - internal/x # extracted from x/tools code - pkg/goformatters/gci/internal # extracted from gci code - pkg/goanalysis/runner_checker.go # extracted from x/tools code rules: - path: (.+)_test\.go linters: - dupl - mnd - lll # Based on existing code, the modifications should be limited to make maintenance easier. - path: pkg/golinters/unused/unused.go linters: [gocritic] text: "rangeValCopy: each iteration copies 160 bytes \\(consider pointers or indexing\\)" # Related to the result of computation but divided multiple times by 1024. - path: test/bench/bench_test.go linters: [gosec] text: "G115: integer overflow conversion uint64 -> int" # The files created during the tests don't need to be secured. - path: scripts/website/expand_templates/linters_test.go linters: [gosec] text: "G306: Expect WriteFile permissions to be 0600 or less" # For compatibility with previous versions. # Also, those reports are not relevant. - linters: [gosec] text: "(G704: SSRF via taint analysis|G703: Path traversal via taint analysis|G702: Command injection via taint analysis|G115: integer overflow conversion uintptr)" # Related to migration command. - path: pkg/commands/internal/migrate/two/ linters: - lll # Related to migration command. - path: pkg/commands/internal/migrate/ linters: - gocritic text: "hugeParam:" # The codes are close but this is not duplication. - path: pkg/commands/(formatters|linters).go linters: - dupl # Deprecated linters - path: pkg/lint/lintersdb/builder_linter.go text: "SA1019: wsl.NewV4 is deprecated: use NewV5 instead." linters: - staticcheck - path: pkg/golinters/wsl/wsl.go text: "SA1019: config.WSLv4Settings is deprecated: use WSLv5Settings instead." linters: - staticcheck formatters: enable: - gofmt - goimports settings: gofmt: rewrite-rules: - pattern: 'interface{}' replacement: 'any' goimports: local-prefixes: - github.com/golangci/golangci-lint/v2 exclusions: paths: - test/testdata_etc # test files - internal/go # extracted from Go code - internal/x # extracted from x/tools code - pkg/goformatters/gci/internal # extracted from gci code - pkg/goanalysis/runner_checker.go # extracted from x/tools code ================================================ FILE: .goreleaser.yml ================================================ version: 2 project_name: golangci-lint builds: - binary: golangci-lint main: ./cmd/golangci-lint/ flags: - -trimpath ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} env: - CGO_ENABLED=0 goos: - darwin - windows - linux - freebsd - netbsd - illumos goarch: - amd64 - arm64 - arm - 386 - ppc64le - s390x - mips64 - mips64le - riscv64 - loong64 goarm: - 6 - 7 gomips: - hardfloat ignore: - goos: darwin goarch: 386 # Deprecated in go1.25, Removed in go1.26 # https://go.dev/doc/go1.25#windows - goos: windows goarch: arm archives: - formats: [ 'tar.gz' ] wrap_in_directory: true format_overrides: - goos: windows formats: [ 'zip' ] name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' files: - LICENSE - README.md snapshot: version_template: SNAPSHOT-{{ .Commit }} checksum: disable: false name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' changelog: sort: asc filters: exclude: - '(?i)^docs?:' - '(?i)^docs\([^:]+\):' - '(?i)^docs\[[^:]+\]:' - '^tests?:' - '(?i)^dev:' - '(?i)^chore:' - '^build\(deps\): bump .* in /docs \(#\d+\)' - '^build\(deps\): bump .* in /\.github/peril \(#\d+\)' - '^build\(deps\): bump .* in /scripts/gen_github_action_config \(#\d+\)' - Merge pull request - Merge branch release: skip_upload: false github: owner: golangci name: golangci-lint header: | `golangci-lint` is a free and open-source project built by volunteers. If you value it, consider supporting us, the [maintainers](https://donate.golangci.org) and [linter authors](https://golangci-lint.run/docs/product/thanks/). We appreciate it! :heart: For key updates, see the [changelog](https://golangci-lint.run/docs/product/changelog/#{{ .Major }}{{ .Minor }}{{ .Patch }}). source: enabled: true name_template: '{{ .ProjectName }}-{{ .Version }}-source' brews: - description: Fast linters runner for Go. homepage: https://golangci.com skip_upload: false repository: owner: golangci name: homebrew-tap commit_author: name: golangci-releaser email: 65486276+golangci-releaser@users.noreply.github.com directory: Formula install: | bin.install "golangci-lint" output = Utils.popen_read("#{bin}/golangci-lint completion bash") (bash_completion/"golangci-lint").write output output = Utils.popen_read("#{bin}/golangci-lint completion zsh") (zsh_completion/"_golangci-lint").write output output = Utils.popen_read("#{bin}/golangci-lint completion fish") (fish_completion/"golangci-lint.fish").write output prefix.install_metafiles test: | system "#{bin}/golangci-lint --version" ## chocolatey is disabled because mono has been removed from GitHub Actions runners due to security and maintenance concerns. ## The release is done manually and locally, with goreleaser after the release of the other elements. ## Note(ldez): add documentation about how to do it. #chocolateys: # - summary: Fast linters Runner for Go # description: | # {{ .ProjectName }} installer package. # Fast linters Runner for Go. # project_url: https://golangci-lint.run # skip_publish: false # name: golangci-lint # title: Golangci-lint # owners: golangci # authors: golangci # copyright: 2024 GolangCI # url_template: "https://github.com/golangci/golangci-lint/releases/download/{{ .Tag }}/{{ .ArtifactName }}" # icon_url: "https://cdn.rawgit.com/golangci/golangci-lint/HEAD/assets/go.png" # license_url: https://github.com/golangci/golangci-lint/blob/HEAD/LICENSE # require_license_acceptance: false # project_source_url: https://github.com/golangci/golangci-lint # package_source_url: https://github.com/golangci/golangci-lint # docs_url: https://golangci-lint.run # bug_tracker_url: https://github.com/golangci/golangci-lint/issues # tags: "go golang lint linter" # release_notes: "https://github.com/golangci/golangci-lint/releases/tag/v{{ .Version }}" # api_key: "{{ .Env.CHOCOLATEY_API_KEY }}" # source_repo: "https://push.chocolatey.org/" # goamd64: v1 aurs: - description: Fast linters runner for Go. skip_upload: false homepage: https://golangci.com provides: - "golangci-lint-bin" maintainers: - "Fernandez Ludovic " license: GPL-3.0 private_key: "{{ .Env.AUR_KEY }}" git_url: "ssh://aur@aur.archlinux.org/golangci-lint-bin.git" commit_author: name: golangci-releaser email: 65486276+golangci-releaser@users.noreply.github.com package: |- local x86_64=amd64 i686=386 aarch64=arm64 armv6h=armv6 armv7h=armv7 cd "golangci-lint-${pkgver}-linux-${!CARCH}" # bin install -Dm755 "./golangci-lint" "${pkgdir}/usr/bin/golangci-lint" # license install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/golangci-lint/LICENSE" # completions mkdir -p "${pkgdir}/usr/share/bash-completion/completions/" mkdir -p "${pkgdir}/usr/share/zsh/site-functions/" mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/" ./golangci-lint completion bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/golangci-lint" ./golangci-lint completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_golangci-lint" ./golangci-lint completion fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/golangci-lint.fish" snapcrafts: - summary: Fast linters runner for Go. description: | It runs linters in parallel, uses caching, supports YAML configuration, integrates with all major IDEs, and includes over a hundred linters. disable: false publish: true name_template: "{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" grade: stable confinement: classic license: GPL-3.0 base: core22 nfpms: - description: Fast linters Runner for Go homepage: https://golangci-lint.run/ id: golangci-lint-nfpms package_name: golangci-lint file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" maintainer: "Golangci-lint Maintainers <65486276+golangci-releaser@users.noreply.github.com>" license: GPLv3 vendor: golangci section: golang formats: - deb - rpm umask: 0o022 overrides: deb: contents: - src: LICENSE dst: /usr/share/doc/golangci-lint/copyright - src: README.md dst: /usr/share/doc/golangci-lint/README.md recommends: - golang-go rpm: contents: - src: LICENSE dst: /usr/share/doc/golangci-lint/LICENSE type: license - src: README.md dst: /usr/share/doc/golangci-lint/README.md type: readme recommends: - /usr/bin/go rpm: group: Development/Tools dockers_v2: - id: golangci-lint images: - 'golangci/golangci-lint' dockerfile: build/buildx.Dockerfile platforms: - linux/amd64 - linux/arm64 tags: - 'latest' - '{{ .Tag }}' - 'v{{ .Major }}.{{ .Minor }}' labels: # https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys 'org.opencontainers.image.title': '{{.ProjectName}}' 'org.opencontainers.image.description': 'Fast linters Runner for Go' 'org.opencontainers.image.source': '{{.GitURL}}' 'org.opencontainers.image.url': '{{.GitURL}}' 'org.opencontainers.image.documentation': 'https://golangci-lint.run' 'org.opencontainers.image.created': '{{.Date}}' 'org.opencontainers.image.revision': '{{.FullCommit}}' 'org.opencontainers.image.version': '{{.Version}}' - id: golangci-lint-alpine images: - 'golangci/golangci-lint' dockerfile: build/buildx-alpine.Dockerfile platforms: - linux/amd64 - linux/arm64 tags: - 'latest-alpine' - '{{ .Tag }}-alpine' - 'v{{ .Major }}.{{ .Minor }}-alpine' labels: # https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys 'org.opencontainers.image.title': '{{.ProjectName}}' 'org.opencontainers.image.description': 'Fast linters Runner for Go' 'org.opencontainers.image.source': '{{.GitURL}}' 'org.opencontainers.image.url': '{{.GitURL}}' 'org.opencontainers.image.documentation': 'https://golangci-lint.run' 'org.opencontainers.image.created': '{{.Date}}' 'org.opencontainers.image.revision': '{{.FullCommit}}' 'org.opencontainers.image.version': '{{.Version}}' ================================================ FILE: .pre-commit-hooks.yaml ================================================ - id: golangci-lint name: golangci-lint description: Fast linters runner for Go. Note that only modified files are linted, so linters like 'unused' that need to scan all files won't work as expected. entry: golangci-lint run --new-from-rev HEAD --fix types: [go] language: golang require_serial: true pass_filenames: false - id: golangci-lint-full name: golangci-lint-full description: Fast linters runner for Go. Runs on all files in the module. Use this hook if you use pre-commit in CI. entry: golangci-lint run --fix types: [go] language: golang require_serial: true pass_filenames: false - id: golangci-lint-fmt name: golangci-lint-fmt description: Fast linters runner for Go. Formats all files in the repo. entry: golangci-lint fmt types: [go] language: golang require_serial: true pass_filenames: false - id: golangci-lint-config-verify name: golangci-lint-config-verify description: Verifies the configuration file entry: golangci-lint config verify files: '\.golangci\.(?:yml|yaml|toml|json)' language: golang pass_filenames: false ================================================ FILE: CHANGELOG-v1.md ================================================ Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) and on [Bluesky](https://bsky.app/profile/golangci-lint.run). `golangci-lint` is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! [![Donate](https://img.shields.io/badge/Donate-❤️-blue?style=for-the-badge)](https://donate.golangci.org) ### v1.64.8 _Released on 2025-03-17_ * Detects use of configuration files from golangci-lint v2 ### v1.64.7 _Released on 2025-03-11_ 1. Linters bug fixes * `depguard`: from 2.2.0 to 2.2.1 * `dupl`: from 3e9179ac440a to f665c8d69b32 * `gosec`: from 2.22.1 to 2.22.2 * `staticcheck`: from 0.6.0 to 0.6.1 2. Documentation * Add GitLab documentation ### v1.64.6 _Released on 2025-03-02_ 1. Linters bug fixes * `asciicheck`: from 0.4.0 to 0.4.1 * `contextcheck`: from 1.1.5 to 1.1.6 * `errcheck`: from 1.8.0 to 1.9.0 * `exptostd`: from 0.4.1 to 0.4.2 * `ginkgolinter`: from 0.19.0 to 0.19.1 * `go-exhaustruct`: from 3.3.0 to 3.3.1 * `gocheckcompilerdirectives`: from 1.2.1 to 1.3.0 * `godot`: from 1.4.20 to 1.5.0 * `perfsprint`: from 0.8.1 to 0.8.2 * `revive`: from 1.6.1 to 1.7.0 * `tagalign`: from 1.4.1 to 1.4.2 ### v1.64.5 _Released on 2025-02-13_ 1. Bug fixes * Add missing flag `new-from-merge-base-flag` 2. Linters bug fixes * `asciicheck`: from 0.3.0 to 0.4.0 * `forcetypeassert`: from 0.1.0 to 0.2.0 * `gosec`: from 2.22.0 to 2.22.1 ### v1.64.4 _Released on 2025-02-12_ 1. Linters bug fixes * `gci`: fix standard packages list for go1.24 ### v1.64.3 _Released on 2025-02-12_ 1. Linters bug fixes * `ginkgolinter`: from 0.18.4 to 0.19.0 * `go-critic`: from 0.11.5 to 0.12.0 * `revive`: from 1.6.0 to 1.6.1 * `gci`: fix standard packages list for go1.24 2. Misc. * Build Docker images with go1.24 ### v1.64.2 _Released on 2025-02-11_ This is the last minor release of golangci-lint v1. The next release will be golangci-lint [v2](https://github.com/golangci/golangci-lint/issues/5300). 1. Enhancements * 🎉 go1.24 support * New `issues.new-from-merge-base` option * New `run.relative-path-mode` option 2. Linters new features * `copyloopvar`: from 1.1.0 to 1.2.1 (support suggested fixes) * `exptostd`: from 0.3.1 to 0.4.1 (handles `golang.org/x/exp/constraints.Ordered`) * `fatcontext`: from 0.5.3 to 0.7.1 (new option: `check-struct-pointers`) * `perfsprint`: from 0.7.1 to 0.8.1 (new options: `integer-format`, `error-format`, `string-format`, `bool-format`, and `hex-format`) * `revive`: from 1.5.1 to 1.6.0 (new rules: `redundant-build-tag`, `use-errors-new`. New option `early-return.early-return`) 3. Linters bug fixes * `go-errorlint`: from 1.7.0 to 1.7.1 * `gochecknoglobals`: from 0.2.1 to 0.2.2 * `godox`: from 006bad1f9d26 to 1.1.0 * `gosec`: from 2.21.4 to 2.22.0 * `iface`: from 1.3.0 to 1.3.1 * `nilnesserr`: from 0.1.1 to 0.1.2 * `protogetter`: from 0.3.8 to 0.3.9 * `sloglint`: from 0.7.2 to 0.9.0 * `spancheck`: fix default `StartSpanMatchersSlice` values * `staticcheck`: from 0.5.1 to 0.6.0 4. Deprecations * ⚠️ `tenv` is deprecated and replaced by `usetesting.os-setenv: true`. * ⚠️ `exportloopref` deprecation step 2 5. Misc. * Sanitize severities by output format * Avoid panic with plugin without description 6. Documentation * Clarify `depguard` configuration ### v1.64.1 _Released on 2025-02-11_ Cancelled due to CI failure. ### v1.64.0 _Released on 2025-02-11_ Cancelled due to CI failure. ### v1.63.4 _Released on 2025-01-03_ 1. Linters bug fixes * `dupl`, `gomodguard`, `revive`: keep only Go-files. ### v1.63.3 _Released on 2025-01-02_ 1. Linters bug fixes * `gofmt`, `gofumpt`, `goimports`, `gci`: panic with several trailing EOL * `goheader`: skip issues with invalid positions ### v1.63.2 _Released on 2025-01-02_ 1. Linters bug fixes * `gofmt`, `gofumpt`, `goimports`, `gci`: panic with missing trailing EOL ### v1.63.1 _Released on 2025-01-01_ 1. Linters bug fixes * `cgi`: invalid reports with cgo * `gofumpt`: panic with autofix and cgo ### v1.63.0 _Released on 2025-01-01_ 1. Enhancements * Add support for SuggestedFixes 🎉 (35 linters can "autofix" reports). * Formatters (`gofmt`, `goimports`, `gofumpt`, `gci`) are applied after the suggested fixes. 2. New linters * Add `exptostd` linter https://github.com/ldez/exptostd * Add `nilnesserr` linter https://github.com/alingse/nilnesserr * Add `usetesting` linter https://github.com/ldez/usetesting 3. Linters new features * `gci`: new options: `no-inline-comments`, `no-prefix-comments` * `gomoddirectives`: from 0.2.4 to 0.6.0 (new options: `go-version-pattern`, `toolchain-pattern`,`toolchain-forbidden`, `tool-forbidden`, `go-debug-forbidden`) * `govet`: new `stdversion`, `waitgroup` analyzers * `importas`: allow multiple empty aliases * `loggercheck`: new `slog` option * `recvcheck`: from 0.1.2 to 0.2.0 (new options: `disable-builtin`, `exclusions`) * `tagliatelle`: from 0.5.0 to 0.7.1 (new options: `ignored-fields`, `extended-rules`,`overrides`, `pkg`, `ignore`) * `usestdlibvars`: from 1.27.0 to 1.28.0 (autofix) * `wrapcheck`: from 2.9.0 to 2.10.0 (new option: `extra-ignore-sigs`) 4. Linters bug fixes * `asciicheck`: from 0.2.0 to 0.3.0 * `bodyclose`: from 574207250966 to ed6a65f985e * `funlen`: from 0.1.0 to 0.2.0 * `ginkgolinter`: from 0.18.3 to 0.18.4 * `gochecksumtype`: from 0.2.0 to 0.3.1 * `gocognit`: from 1.1.3 to 1.2.0 * `godot`: from 1.4.18 to 1.4.20 * `goheader`: report position improvement * `gosec`: handling of global nosec option when it is false * `iface`: from 1.2.1 to 1.3.0 * `importas`: from 0.1.0 to 0.2.0 * `intrange`: from 0.2.1 to 0.3.0 * `makezero`: from 1.1.1 to 1.2.0 * `mirror`: from 1.2.0 to 1.3.0 * `nilnil`: from 1.0.0 to 1.0.1 * `nosprintfhostport`: from 0.1.1 to 0.2.0 * `reassign`: from 0.2.0 to 0.3.0 * `spancheck`: from 0.6.2 to 0.6.4 * `tagalign`: from 1.3.4 to 1.4.1 * `wastedassign`: from 2.0.7 to 2.1.0 * `whitespace`: from 0.1.1 to 0.2.0 * `wsl`: from 4.4.1 to 4.5.0 5. Deprecations * ⚠️ `output.uniq-by-line` is deprecated and replaced by `issues.uniq-by-line`. 6. Misc. * Improvements of the help command (color and JSON support). * Removes `decoder`, `sloglint`, `tagalign` from `format` preset. * Enables paths with junction inside Windows. * The timeout is disabled if `run.timeout` <= 0. ### v1.62.2 _Released on 2024-11-25_ 1. Linters bug fixes * `fatcontext`: from 0.5.2 to 0.5.3 * `ginkgolinter`: from 0.18.0 to 0.18.3 * `errorlint`: from 1.6.0 to 1.7.0 * `iface`: from 1.2.0 to 1.2.1 * `revive`: from 1.5.0 to 1.5.1 * `testifylint`: from 1.5.0 to 1.5.2 2. Misc. * fix: ignore cache error when file not found ### v1.62.1 _Released on 2024-11-25_ Cancelled due to CI failure. ### v1.62.0 _Released on 2024-11-10_ 1. New linters * Add `recvcheck` linter https://github.com/raeperd/recvcheck * Add `iface` linter https://github.com/uudashr/iface 2. Linters new features * `ginkgolinter`: from 0.17.0 to 0.18.0 (new option: `force-succeed`) * `gochecksumtype`: from 0.1.4 to 0.2.0 (new option: `default-signifies-exhaustive`) * `loggercheck`: from 0.9.4 to 0.10.1 (`log/slog` support) * `nilnil`: from 0.1.9 to 1.0.0 (new option: `detect-opposite`) * `revive`: from 1.3.9 to 1.5.0 (new rules: `filename-format`, and `file-length-limit`) * `tenv`: from 1.10.0 to 1.12.1 (handle dot import) * `testifylint`: from 1.4.3 to 1.5.0 (new checkers: `contains`, `encoded-compare`, `regexp`) 3. Linters bug fixes * `bidichk`: from 0.2.7 to 0.3.2 (important performance improvement) * `canonicalheader`: from 1.1.1 to 1.1.2 * `cyclop`: from 1.2.1 to 1.2.3 * `dupword`: from 0.1.1 to 0.1.3 * `errcheck`: from 1.7.0 to 1.8.0 * `errchkjson`: from 0.3.6 to 0.4.0 * `errname`: from 0.1.13 to 1.0.0 * `gocritic`: from 0.11.4 to 0.11.5 * `goprintffuncname`: from 7558a9eaa5af to v0.1.0 * `godot`: from 1.4.17 to 1.4.18 * `gosec`: from 2.21.2 to 2.21.4 * `intrange`: from 0.2.0 to 0.2.1 * `musttag`: from 0.12.2 to 0.13.0 * `nakedret`: from 2.0.4 to 2.0.5 * `noctx`: from 0.0.2 to 0.1.0 * `protogetter`: from 0.3.6 to 0.3.8 4. Deprecations * ⚠️ `execinquery`: deprecation step 2 * ⚠️ `gomnd`: deprecation step 2 (replaced by `mnd`) 5. Misc. * Type sizing when cross-compiling (32-bit). * code-climate: add check_name field * Improve Go version detection * Fix Go version propagation 6. Documentation * Adds a section about `exclude-dirs-use-default` * Improve 'install from sources' section * Improve FAQ about Go versions * Improve linter/rule/check docs * Improve new linter section * Improve `forbidigo` pattern examples for built-in functions ### v1.61.0 _Released on 2024-09-09_ 1. Enhancements * Add `junit-xml-extended` format * Exclude Swagger Codegen files by default 2. Linters new features * `gci`: from 0.13.4 to 0.13.5 (new option `no-lex-order`) * `nolintlint`: remove the empty line in the directive replacement 3. Linters bug fixes * `dupword`: from 0.0.14 to 0.1.1 * `fatcontext`: from 0.4.0 to 0.5.2 * `go-ruleguard`: from 0.4.2 to 0fe6f58b47b1 (fix panic with custom linters) * `godot`: from 1.4.16 to 1.4.17 * `gomodguard`: from 1.3.3 to 1.3.5 * `gosec`: disable temporarily `G407` * `gosec`: from ab3f6c1c83a0 to 2.21.2 (partially fix `G115`) * `intrange`: from 0.1.2 to 0.2.0 4. Misc. * Improve runtime version parsing 5. Documentation * Add additional info about `typecheck` ### v1.60.3 _Released on 2024-08-22_ 1. Updated linters * `gosec`: from 81cda2f91fbe to ab3f6c1c83a0 (fix `G115` false positives) 2. Misc. * Check that the Go version use to build is greater or equals to the Go version of the project ### v1.60.2 _Released on 2024-08-20_ 1. Linters new features * `gosec`: from 5f0084eb01a9 to 81cda2f91fbe (adds `G115`, `G405`, `G406`, `G506`, `G507`) 2. Linters bug fixes * `gofmt`: update to HEAD (go1.22) * `gofumpt`: from 0.6.0 to 0.7.0 * `gosec`: fix G602 analyzer * `staticcheck`: from 0.5.0 to 0.5.1 * `staticcheck`: propagate Go version * `wrapcheck`: from 2.8.3 to 2.9.0 3. Deprecations * ⚠️ `exportloopref`: deprecation ### v1.60.1 _Released on 2024-08-14_ 1. Misc. * 🎉 go1.23 support 2. Linters new features * `exhaustruct`: from 3.2.0 to 3.3.0 (recognize custom error values in return) * `govet` (`printf`): report non-constant format, no args * `lll`: advertise max line length instead of just reporting failure * `revive`: from 1.3.7 to 1.3.9 (new rule: `comments-density`) * `staticcheck`: from 0.4.7 to 0.5.0 * `testifylint`: from 1.3.1 to 1.4.3 (new options: `formatter`, `suite-broken-parallel`, `suite-subtest-run`) 3. Linters bug fixes * `errorlint`: from 1.5.2 to 1.6.0 * `fatcontext`: from 0.2.2 to 0.4.0 (fix false positives for context stored in structs) * `gocognit`: from 1.1.2 to 1.1.3 * `gomodguard`: from 1.3.2 to 1.3.3 * `sloglint`: from 0.7.1 to 0.7.2 * `spancheck`: from 0.6.1 to 0.6.2 * `tenv`: from 1.7.1 to 1.10.0 (remove reports on fuzzing) * `tparallel`: from 0.3.1 to 0.3.2 * `usestdlibvars`: from 1.26.0 to 1.27.0 (fix false-positive with number used inside a mathematical operations) * `wsl`: from 4.2.1 to 4.4.1 4. Deprecations * ️⚠️ `unused`: remove `exported-is-used` option 5. Fixes * SARIF: sanitize level property * ️⚠️ `typecheck` issues should never be ignored 6. Documentation * Add link on linter without configuration * Remove 'trusted by' page * `wsl` update documentation of the configuration ### v1.60.0 _Released on 2024-08-13_ Cancelled due to a CI problem. ### v1.59.1 _Released on 2024-06-09_ 1. Updated linters * `errorlint`: from 1.5.1 to 1.5.2 * `gomnd`: deprecated configuration compatibility * `intrange`: add `style` preset * `misspell`: from 0.5.1 to 0.6.0 * `sloglint`: from 0.7.0 to 0.7.1 * `testifylint`: from 1.3.0 to 1.3.1 * `unparam`: bump to HEAD * `usestdlibvars`: from 1.25.0 to 1.26.0 2. Fixes * SARIF: init empty result slice * SARIF: issue column >= 1 3. Documentation * `revive`: update documentation of the configuration ### v1.59.0 _Released on 2024-05-26_ 1. Enhancements * Add SARIF output format * Allow the analysis of generated files (`issues.exclude-generated: disable`) 2. Updated linters * `errcheck`: fix deprecation warning * `gocritic`: from 0.11.3 to 0.11.4 * `gosec`: from 2.20.0 to 5f0084eb01a9 (fix G601 and G113 performance issues) * `sloglint`: from 0.6.0 to 0.7.0 (new option `forbidden-keys`) * `testifylint`: from 1.2.0 to 1.3.0 (new checker `negative-positive` and new option `go-require.ignore-http-handlers`) 3. Misc. * ️️⚠️ Deprecate `github-action` output format * ️️⚠️ Deprecate `issues.exclude-generated-strict` option (replaced by `issues.exclude-generated: strict`) * ️️⚠️ Add warning about disabled and deprecated linters (level 2) ### v1.58.2 _Released on 2024-05-19_ 1. Updated linters * `canonicalheader`: from 1.0.6 to 1.1.1 * `gosec`: from 2.19.0 to 2.20.0 * `musttag`: from 0.12.1 to 0.12.2 * `nilnil`: from 0.1.8 to 0.1.9 2. Documentation * Improve integrations and install pages ### v1.58.1 _Released on 2024-05-08_ 1. Updated linters * `tagalign`: from 1.3.3 to 1.3.4 * `protogetter`: from 0.3.5 to 0.3.6 * `gochecknoinits`: fix analyzer name 2. Fixes * Restores previous `github-actions` output format (removes GitHub Action problem matchers) ### v1.58.0 _Released on 2024-05-03_ 1. New linters * `fatcontext`: https://github.com/Crocmagnon/fatcontext * `canonicalheader`: https://github.com/lasiar/canonicalheader 2. Updated linters * `copyloopvar`: from 1.0.10 to 1.1.0 (`ignore-alias` is replaced by `check-alias` with the opposite behavior) * `decorder`: from 0.4.1 to 0.4.2 * `errname`: from 0.1.12 to 0.1.13 * `errorlint`: from 1.4.8 to 1.5.1 (new options `allowed-errors` and `allowed-errors-wildcard`) * `execinquery`: deprecate linter ⚠️ * `gci`: from 0.12.3 to 0.13.4 (new section `localModule`) * `gocritic`: from 0.11.2 to 0.11.3 * `spancheck`: from 0.5.3 to 0.6.1 * `goerr113` is replaced by `err113` ⚠️ * `gomnd` is replaced by `mnd` ⚠️ * `gomodguard`: from 1.3.1 to 1.3.2 * `grouper`: from 1.1.1 to 1.1.2 * `intrange`: from 0.1.1 to 0.1.2 * `mirror`: from 1.1.0 to 1.2.0 * `misspell`: from 0.4.1 to 0.5.1 * `musttag`: from 0.9.0 to 0.12.1 * `nilnil`: from 0.1.7 to 0.1.8 * `nonamedreturns`: from 1.0.4 to 1.0.5 * `promlinter`: from 0.2.0 to 0.3.0 * `sloglint`: from 0.5.0 to 0.6.0 * `unparam`: bump to HEAD (063aff900ca150b80930c8de76f11d7e6488222f) * `whitespace`: from 0.1.0 to 0.1.1 3. Enhancements * Speed up "fast" linters when only "fast" linters are run: between 40% and 80% faster at first run (i.e. without cache) 4. Fixes * Use version with module plugins * Skip `go.mod` report inside autogenerated processor * Keep only `typecheck` issues when needed * Don't hide `typecheck` errors inside diff processor 5. Misc. * ⚠️ log an error when using previously deprecated linters ([Linter Deprecation Cycle](https://golangci-lint.run/docs/product/roadmap/#linter-deprecation-cycle)) * [`deadcode`](https://github.com/remyoudompheng/go-misc/tree/HEAD/deadcode): deprecated since v1.49.0 (2022-08-23). * [`exhaustivestruct`](https://github.com/mbilski/exhaustivestruct): deprecated since v1.46.0 (2022-05-08). * [`golint`](https://github.com/golang/lint): deprecated since v1.41.0 (2021-06-15). * [`ifshort`](https://github.com/esimonov/ifshort): deprecated since v1.48.0 (2022-08-04). * [`interfacer`](https://github.com/mvdan/interfacer): deprecated since v1.38.0 (2021-03-03). * [`maligned`](https://github.com/mdempsky/maligned): deprecated since v1.38.0 (2021-03-03). * [`nosnakecase`](https://github.com/sivchari/nosnakecase): deprecated since v1.48.0 (2022-08-04). * [`scopelint`](https://github.com/kyoh86/scopelint): deprecated since v1.39.0 (2021-03-25). * [`structcheck`](https://github.com/opennota/check): deprecated since v1.49.0 (2022-08-23). * [`varcheck`](https://github.com/opennota/check): deprecated since v1.49.0 (2022-08-23). * ⚠️ Deprecate usage of linter alternative names * Remove help display on errors with `config verify` command * Add `pre-commit` hook to run `config verify` * Improve `github-action` output 6. Documentation * Remove deprecated Atom from Editor Integrations GitHub Action (v5.1.0) for golangci-lint: - supports for `pull`, `pull_request_target`, and `merge_group` events with the option `only-new-issues`. - ️️⚠️ `skip-pkg-cache` and `skip-build-cache` have been removed because the cache related to Go itself is already handled by `actions/setup-go`. - with golangci-lint v1.58, the file information (path and position) will be displayed on the log. ### v1.57.2 _Released on 2024-03-28_ 1. Updated linters * `contextcheck`: from 1.1.4 to 1.1.5 * `copyloopvar`: from 1.0.8 to 1.0.10 * `ginkgolinter`: from 0.16.1 to 0.16.2 * `goconst`: from 1.7.0 to 1.7.1 * `gomoddirectives`: from 0.2.3 to 0.2.4 * `intrange`: from 0.1.0 to 0.1.1 2. Misc. * Display warnings on deprecated linter options * Fix missing `colored-tab` output format * Fix TeamCity `inspectionType` service message 3. Documentation * Remove invalid example about mixing files and directory * Improve linters page ### v1.57.1 _Released on 2024-03-20_ 1. Fixes * Ignore issues with invalid position (e.g. `contextcheck`). ### v1.57.0 _Released on 2024-03-19_ 1. New linters * `copyloopvar`: https://github.com/karamaru-alpha/copyloopvar * `intrange`: https://github.com/ckaznocha/intrange 2. Updated linters * `dupword`: from 0.0.13 to 0.0.14 * `gci`: from 0.12.1 to 0.12.3 * `ginkgolinter`: from 0.15.2 to 0.16.1 (new option `force-expect-to`, `validate-async-intervals`, and `forbid-spec-pollution`) * `go-critic`: from 0.11.1 to 0.11.2 * `go-critic`: support of `enable-all` and `disable-all` options * `go-spancheck`: from 0.5.2 to 0.5.3 * `gomodguard`: from 1.3.0 to 1.3.1 * `govet`: deprecation of `check-shadowing` ⚠️ * `govet`: disable temporarily `httpresponse` because of a bug https://github.com/golang/go/issues/66259 * `misspell`: add `extra-words` * `musttag`: from 0.8.0 to 0.9.0 * `nakedret`: from 2.0.2 to 2.0.4 * `paralleltest`: from 1.0.9 to 1.0.10 * `perfsprint`: from 0.6.0 to 0.7.1 (new option `strconcat`) * `protogetter`: from 0.3.4 to 0.3.5 * `revive`: add `exclude` option * `sloglint`: from 0.4.0 to 0.5.0 (new option `no-global`) * `staticcheck`: from 0.4.6 to 0.4.7 * `testifylint`: from 1.1.2 to 1.2.0 (new option `bool-compare`) * `unconvert`: to HEAD (new options `fast-math` and `safe`) * `wrapcheck`: from 2.8.1 to 2.8.3 * Disable `copyloopvar` and `intrange` on Go < 1.22 3. Enhancements * 🧩New custom linters system https://golangci-lint.run/docs/plugins/module-plugins/ * Allow running only a specific linter without modifying the file configuration (`--enable-only`) * Allow custom sort order for the reports (`output.sort-order`) * Automatically adjust the maximum concurrency to the container CPU quota if `run.concurrency=0` * Add `config verify` command to check the configuration against the JSON Schema * Option to strictly follow Go generated file convention (`issues.exclude-generated-strict`) * Syntax to not override `severity` from linters (`@linter`) * Use severities from `gosec` * Create automatically directory related to `output.formats.path` * Use the first issue without inline on `mergeLineIssues` on multiple issues 4. Misc. * ⚠️ Inactivate deprecated linters (`deadcode`, `exhaustivestruct`, `golint`, `ifshort`, `interfacer`, `maligned`, `nosnakecase`, `scopelint`, `structcheck`, `varcheck`) * ⚠️ Deprecated CLI flags have been removed (deprecated since 2018) * ⚠️ Move `show-stats` option from `run` to `output` configuration section * ⚠️ Replace `run.skip-xxx` options by `issues.exclude-xxx` options * ⚠️ Replace `output.format` by `output.formats` with a new file configuration syntax * Internal rewrite of the CLI * Improve 'no go files to analyze' message * Use `GOTOOLCHAIN=auto` inside the Docker images 5. Documentation * ⚠️ Define the linter deprecation cycle https://golangci-lint.run/docs/product/roadmap/#linter-deprecation-cycle * 🎉Use information from the previous release to create linter pages * Publish JSON schema on https://golangci-lint.run/jsonschema/golangci.jsonschema.json * Reorganize documentation pages * Add an explanation about the configuration file inside golangci-lint repository **⚠️ Important ⚠️** 1. Deprecated linters are inactivated, you still need to disable them if you are using `enable-all`. 2. Deprecated CLI flags (about linter settings and `deadline`) have been removed. ### v1.56.2 _Released on 2024-02-15_ 1. updated linters * `go-critic`: from 0.11.0 to 0.11.1 * `gosec`: from 2.18.2 to 2.19.0 * `testifylint`: from 1.1.1 to 1.1.2 * `usestdlibvars`: from 1.24.0 to 1.25.0 * `wsl`: from 4.2.0 to 4.2.1 2. misc. * Fix missing version in Docker image 3. Documentation * Explain the limitation of `new-from-rev` and `new-from-patch` ### v1.56.1 _Released on 2024-02-08_ 1. updated linters * `errcheck`: from 1.6.3 to 1.7.0 * `govet`: disable `loopclosure` with go1.22 * `revive`: from 1.3.6 to 1.3.7 * `testifylint`: from 1.1.0 to 1.1.1 ### v1.56.0 _Released on 2024-02-07_ 1. new linters * `spancheck`: https://github.com/jjti/go-spancheck 2. updated linters * `depguard`: from 2.1.0 to 2.2.0 * `exhaustive`: from 0.11.0 to 0.12.0 * `exhaustruct`: from 3.1.0 to 3.2.0 * `gci`: from 0.11.2 to 0.12.1 * `ginkgolinter`: from 0.14.1 to 0.15.2 * `go-check-sumtype`: from 0.1.3 to 0.1.4 * `go-critic`: from 0.9.0 to 0.11.0 * `go-errorlint`: from 1.4.5 to 1.4.8 * `go-spancheck`: from 0.4.2 to 0.5.2 * `goconst`: from 1.6.0 to 1.7.0 * `godot`: from 1.4.15 to 1.4.16 * `gofumpt`: from 0.5.0 to 0.6.0 * `inamedparam`: from 0.1.2 to 0.1.3 * `ineffassign`: from 0.0.0-20230610083614-0e73809eb601 to 0.1.0 * `ireturn`: from 0.2.2 to 0.3.0 * `misspell`: add mode option * `musttag`: from v0.7.2 to v0.8.0 * `paralleltest`: from 1.0.8 to 1.0.9 * `perfsprint`: from 0.2.0 to 0.6.0 * `protogetter`: from 0.2.3 to 0.3.4 * `revive`: from 1.3.4 to 1.3.6 * `sloglint`: add static-msg option * `sloglint`: from 0.1.2 to 0.4.0 * `testifylint`: from 0.2.3 to 1.1.0 * `unparam`: from 20221223090309-7455f1af531d to 20240104100049-c549a3470d14 * `whitespace`: update after moving to the `analysis` package * `wsl`: from 3.4.0 to 4.2.0 * `zerologlint`: from 0.1.3 to 0.1.5 3. misc. * 🎉 go1.22 support * Implement stats per linter with a flag * Make versioning inside Docker image consistent with binaries * Parse Go RC version 4. Documentation * Fix `noctx` description * Add missing fields to `.golangci.reference.yml` * Improve `.golangci.reference.yml` defaults * `typecheck`: improve FAQ * `exhaustruct`: note that struct regular expressions are expected to match the entire `package/name/structname` * `wrapcheck`: adjust `ignoreSigs` to new defaults **Important** `testifylint` has [breaking changes](https://github.com/Antonboom/testifylint/releases/tag/v1.0.0) about enabling/disabling checks: - If you were using the option `enable` with a filtered list of checks, you should either add `disable-all: true` (1) or use `disable` field (2). ```yml # Example (1) testifylint: disable-all: true enable: - bool-compare - compares - empty - error-is-as - error-nil - expected-actual - go-require - float-compare - len - nil-compare - require-error # - suite-dont-use-pkg - suite-extra-assert-call - suite-thelper ``` ```yml # Example (2) testifylint: disable: - suite-dont-use-pkg ``` ### v1.55.2 _Released on 2023-11-03_ 1. updated linters * `ireturn`: from 0.2.1 to 0.2.2 * `ginkgolinter`: from 0.14.0 to 0.14.1 ### v1.55.1 _Released on 2023-10-25_ 1. updated linters * `gosec`: from 2.18.1 to 2.18.2 2. misc. * `revgrep`: from v0.5.0 to v0.5.2 (support git < 2.41.0) * output: convert backslashes to forward slashes for GitHub Action annotations printer ### v1.55.0 _Released on 2023-10-20_ 1. new linters * `gochecksumtype`: https://github.com/alecthomas/go-check-sumtype * `inamedparam`: https://github.com/macabu/inamedparam * `perfsprint`: https://github.com/catenacyber/perfsprint * `protogetter`: https://github.com/ghostiam/protogetter * `sloglint`: https://github.com/go-simpler/sloglint * `testifylint`: https://github.com/Antonboom/testifylint 2. updated linters * `bidichk`: from 0.2.4 to 0.2.7 * `decorder`: from 0.4.0 to 0.4.1 * `dupword`: from 0.0.12 to 0.0.13 * `errchkjson`: from 0.3.1 to 0.3.6 * `gci`: from 0.11.0 to 0.11.2 * `ginkgolinter`: from 0.13.5 to 0.14.0 * `go-errorlint`: from 1.4.4 to 1.4.5 * `gocognit`: from 1.0.7 to 1.1.0 * `goconst`: from 1.5.1 to 1.6.0 * `godot`: from 1.4.14 to 1.4.15 * `gofmt`: update to HEAD * `goimports`: update to HEAD * `gosec`: from 2.17.0 to 2.18.1 * `gosmopolitan`: from 1.2.1 to 1.2.2 * `govet`: add `appends` analyzer * `ireturn`: from 0.2.0 to 0.2.1 * `protogetter`: from 0.2.2 to 0.2.3 * `revgrep`: from 745bb2f7c2e6 to v0.5.0 * `revive`: from 1.3.2 to 1.3.4 * `sqlclosecheck`: from 0.4.0 to 0.5.1 * `staticcheck`: from 0.4.5 to 0.4.6 * `tagalign`: from 1.3.2 to 1.3.3 * `unused`: support passing in options 3. misc. * Add a pre-commit hook to check all files 4. Documentation * add source options to exclude-rules docs * `gosec`: add G602 to includes/excludes inside .golangci.reference.yml ### v1.54.2 _Released on 2023-08-21_ 1. updated linters: * `errname`: from 0.1.10 to 0.1.12 * `ginkgolinter`: from 0.13.3 to 0.13.5 * `go-errorlint`: from 1.4.3 to 1.4.4 * `godot`: from 1.4.11 to 1.4.14 * `gosec`: from 2.16.0 to 2.17.0 * `musttag`: from 0.7.1 to 0.7.2 * `nilnil`: from 0.1.5 to 0.1.7 * `staticcheck`: from 0.4.3 to 0.4.5 * `usestdlibvars`: from 1.23.0 to 1.24.0 * `govet`: add missing `directive` and `slog` passes ### v1.54.1 _Released on 2023-08-11_ 1. updated linters: * `go-critic`: from 0.8.2 to 0.9.0 2. misc. * plugin: temporarily hide warning about using plugins using the old API ### v1.54.0 _Released on 2023-08-09_ 1. updated linters: * `decorder`: from 0.2.3 to 0.4.0 * `dupword`: from 0.0.11 to 0.0.12 * `errorlint`: from 1.4.2 to 1.4.3 * `exhaustruct`: from 2.3.0 to 3.1.0 * `forbidigo`: from 1.5.3 to 1.6.0 * `funlen`: from 0.0.3 to 0.1.0 * `gci`: from 0.10.1 to 0.11.0 * `ginkgolinter`: from 0.12.1 to 0.13.3 * `go-critic`: from 0.8.1 to 0.8.2 * `go-errorlint`: from 1.4.2 to 1.4.3 * `go-exhaustruct`: from 2.3.0 to 3.1.0 * `gocognit`: from 1.0.6 to 1.0.7 * `gocritic`: from 0.8.1 to 0.8.2 * `gofmt`: autofix missing newline at EOF * `misspell`: 0.4.0 to 0.4.1 * `musttag`: from 0.7.0 to 0.7.1 * `paralleltest`: from 1.0.7 to 1.0.8 * `tagalign`: from 1.2.2 to 1.3.2 * `typecheck`: explain it and remove it from the linter list * `zerologlint`: from 0.1.2 to 0.1.3 2. misc. * 🎉 go1.21 support * plugin: include custom linters in `enable-all` * plugin: allow to use settings for plugins 3. Documentation * Add linter descriptions. **Important** `ruleguard` (a "rule" inside `gocritic`) was disabled in this release (v1.54.0) and was enabled again in the next release (v1.54.1). `exhaustruct` has breaking changes with regular expressions, more details [here](https://github.com/GaijinEntertainment/go-exhaustruct/releases/tag/v3.0.0). ### v1.53.3 _Released on 2023-06-15_ 1. updated linters: * `cyclop`: from 1.2.0 to 1.2.1 * `exhaustive`: from 0.10.0 to 0.11.0 * `forbidigo`: from 1.5.1 to 1.5.3 * `ginkgolinter`: from 0.12.2 to 0.12.1 * `ineffassign`: bump to HEAD * `nakedret`: from 2.0.1 to 2.0.2 * `zerologlint`: from 0.1.1 to 0.1.2 2. misc. * codeclimate: reduce memory allocation * support illumos/amd64 ### v1.53.2 _Released on 2023-06-03_ 1. updated linters * `depguard`: from v2.0.1 to 2.1.0 2. misc. * `depguard`: throw error only when the linter is called ### v1.53.1 _Released on 2023-06-02_ 1. misc. * `depguard`: fix GOROOT detection * `importas`: fix duplication detection when aliases use regular expression replacement pattern ### v1.53.0 _Released on 2023-06-01_ 1. new linters * `gosmopolitan`: https://github.com/xen0n/gosmopolitan * `mirror`: https://github.com/butuzov/mirror * `tagalign`: https://github.com/4meepo/tagalign * `zerologlint`: https://github.com/ykadowak/zerologlint 2. updated linters * `bodyclose`: bump to HEAD * `containedctx`: from 1.0.2 to 1.0.3 * `depguard`: migrate to v2 * `errname`: from 0.1.9 to 0.1.10 * `exhaustive`: from 0.9.5 to 0.10.0 * `forbidigo`: better support for configuring complex rules * `gci`: improve error message * `ginkgolinter`: add suppress-async-assertion option * `ginkgolinter`: from 0.9.0 to 0.12.0 * `go-critic`: from 0.7.0 to 0.8.1 * `go-errorlint`: from 1.4.0 to 1.4.2 * `gofumpt`: from 0.4.0 to 0.5.0 * `gosec`: convert global settings as map with proper key type * `gosec`: from 2.15.0 to 2.16.0 * `importas`: detect duplicate alias or package in the configuration * `importas`: fix typo in logs * `ireturn`: from 0.1.1 to 0.2.0 * `musttag`: from 0.5.0 to 0.7.0 * `nakedret`: to 2.0.1 * `nilnil`: from 0.1.3 to 0.1.5 * `paralleltest`: from 1.0.6 to 1.0.7 * `revive`: from 1.3.1 to 1.3.2 * `tagliatelle`: from 0.4.0 to 0.5.0 * `usestdlibvars`: fix configuration 3. misc. * `golang.org/x/tools`: from 0.7.0 to 0.9.2 * add loongarch64 to the install script * output: add colored-tab * remove warning when the config file is explicitly stdin * rules: support inverted path match 4. Documentation * `mnd`: clarify ignore usage examples to be regexps * `tagliatelle`: update documentation * improve features section * update supported Go versions FAQ ### v1.52.2 _Released on 2023-03-25_ 1. updated linters * `tparallel`: from 0.3.0 to 0.3.1 2. misc. * fix: pre-commit `require_serial` and `pass_filenames` ### v1.52.1 _Released on 2023-03-21_ 1. misc. * fix: improve panic management * fix: the combination of --fix and --path-prefix ### v1.52.0 _Released on 2023-03-18_ 1. updated linters * `asciicheck`: from 0.1.1 to 0.2.0 * `bidichk`: from 0.2.3 to 0.2.4 * `contextcheck`: from 1.1.3 to 1.1.4 * `dupword`: from 0.0.9 to 0.0.11 * `durationcheck`: from 0.0.9 to 0.0.10 * `errchkjson`: from 0.3.0 to 0.3.1 * `errname`: from 0.1.7 to 0.1.9 * `forbidigo`: from 1.4.0 to 1.5.1 * `gci`: from 0.9.1 to 0.10.1 * `ginkgolinter`: from 0.8.1 to 0.9.0 * `go-critic`: from 0.6.7 to 0.7.0 * `go-errorlint`: from 1.1.0 to 1.4.0 * `godox`: bump to HEAD * `lll`: skip go command * `loggercheck`: from 0.9.3 to 0.9.4 * `musttag`: from 0.4.5 to 0.5.0 * `nilnil`: from 0.1.1 to 0.1.3 * `noctx`: from 0.0.1 to 0.0.2 * `revive`: from 1.2.5 to 1.3.1 * `rowserrcheck`: remove limitation related to generics support * `staticcheck`: from 0.4.2 to 0.4.3 * `testpackage`: from 1.1.0 to 1.1.1 * `tparallel`: from 0.2.1 to 0.3.0 * `wastedassign`: remove limitation related to generics support * `wrapcheck`: from 2.8.0 to 2.8.1 2. misc. * Add TeamCity output format * Consider path prefix when matching path patterns * Add Go version to version information 3. Documentation * Add Tekton in Trusted By page * Clarify that custom linters are not enabled by default * Remove description for deprecated "go" option ### v1.51.2 _Released on 2023-02-19_ 1. updated linters * `forbidigo`: from 1.3.0 to 1.4.0 * `gci`: from 0.9.0 to 0.9.1 * `go-critic`: from 0.6.5 to 0.6.7 * `go-errorlint`: from 1.0.6 to 1.1.0 * `gosec`: from 2.14.0 to 2.15.0 * `musttag`: from 0.4.4 to 0.4.5 * `staticcheck`: from 0.4.0 to 0.4.2 * `tools`: from 0.5.0 to 0.6.0 * `usestdlibvars`: from 1.21.1 to 1.23.0 * `wsl`: from 3.3.0 to 3.4.0 * `govet`: enable `timeformat` by default 2. misc. * fix: cache status size calculation * add new source archive 3. Documentation * Improve installation section * Replace links to godoc.org with pkg.go.dev ### v1.51.1 _Released on 2023-02-05_ 1. updated linters * `ginkgolinter`: from 0.7.1 to 0.8.1 * `ineffassign`: bump to HEAD * `musttag`: from 0.4.3 to 0.4.4 * `sqlclosecheck`: from 0.3.0 to 0.4.0 * `staticcheck`: bump to v0.4.0 * `wastedassign`: from 2.0.6 to 2.0.7 * `wrapcheck`: from 2.7.0 to 2.8.0 ### v1.51.0 _Released on 2023-02-02_ 1. new linters * `ginkgolinter`: https://github.com/nunnatsa/ginkgolinter * `musttag`: https://github.com/tmzane/musttag * `gocheckcompilerdirectives`: https://github.com/leighmcculloch/gocheckcompilerdirectives 2. updated linters * `bodyclose`: to HEAD * `dupword`: from 0.0.7 to 0.0.9 * `errcheck`: from 1.6.2 to 1.6.3 * `exhaustive`: from 0.8.3 to 0.9.5 * `exportloopref`: from 0.1.8 to 0.1.11 * `gci`: from 0.8.1 to 0.9.0 * `ginkgolinter`: from 0.6.0 to 0.7.1 * `go-errorlint`: from 1.0.5 to 1.0.6 * `go-ruleguard`: from 0.3.21 to 0.3.22 * `gocheckcompilerdirectives`: from 1.1.0 to 1.2.1 * `gochecknoglobals`: from 0.1.0 to 0.2.1 * `gomodguard`: from 1.2.4 to 1.3.0 * `gosec`: from 2.13.1 to 2.14.0 * `govet`: Add `timeformat` to analysers * `grouper`: from 1.1.0 to 1.1.1 * `musttag`: from 0.4.1 to 0.4.3 * `revive`: from 1.2.4 to 1.2.5 * `tagliatelle`: from 0.3.1 to 0.4.0 * `tenv`: from 1.7.0 to 1.7.1 * `unparam`: bump to HEAD * `usestdlibvars`: from 1.20.0 to 1.21.1 * `wsl`: fix `force-err-cuddling` flag 3. misc. * go1.20 support * remove deprecated linters from presets * Build NetBSD binaries * Build loong64 binaries 4. Documentation * `goimport`: improve documentation for local-prefixes * `gomnd`: add missing always ignored functions * `nolint`: fix typo * `tagliatelle` usage typo * add note about binary requirement for plugin * cache preserving and colored output on docker runs * improve documentation about debugging. * improve Editor Integration section * More specific default cache directory * update output example to use valid checkstyle example; add json example ### v1.50.1 _Released on 2022-10-22_ 1. updated linters * `contextcheck`: from 1.1.2 to 1.1.3 * `go-mnd`: from 2.5.0 to 2.5.1 * `wrapcheck`: from 2.6.2 to 2.7.0 * `revive`: fix configuration parsing * `lll`: skip imports 2. misc. * windows: remove redundant character escape '\/' * code-climate: add default severity ### v1.50.0 _Released on 2022-10-04_ 1. new linters * `dupword`: https://github.com/Abirdcfly/dupword * `testableexamples`: https://github.com/maratori/testableexamples 2. updated linters * `contextcheck`: change owner * `contextcheck`: from 1.0.6 to 1.1.2 * `depguard`: from 1.1.0 to 1.1.1 * `exhaustive`: add missing config * `exhaustive`: from 0.8.1 to 0.8.3 * `gci`: from 0.6.3 to 0.8.0 * `go-critic`: from 0.6.4 to 0.6.5 * `go-errorlint`: from 1.0.2 to 1.0.5 * `go-reassign`: v0.1.2 to v0.2.0 * `gofmt`: add option `rewrite-rules` * `gofumpt` from 0.3.1 to 0.4.0 * `goimports`: update to HEAD * `interfacebloat`: fix configuration loading * `logrlint`: rename `logrlint` to `loggercheck` * `paralleltest`: add tests of the ignore-missing option * `revive`: from 1.2.3 to 1.2.4 * `usestdlibvars`: from 1.13.0 to 1.20.0 * `wsl`: support all configs and update docs 3. misc. * Normalize `exclude-rules` paths for Windows * add riscv64 to the install script 4. Documentation * cli: remove reference to old service ### v1.49.0 _Released on 2022-08-24_ IMPORTANT: `varcheck` and `deadcode` has been removed of default linters. 1. new linters * `interfacebloat`: https://github.com/sashamelentyev/interfacebloat * `logrlint`: https://github.com/timonwong/logrlint * `reassign`: https://github.com/curioswitch/go-reassign 2. updated linters * `go-colorable`: from 0.1.12 to 0.1.13 * `go-critic`: from 0.6.3 to 0.6.4 * `go-errorlint`: from 1.0.0 to 1.0.2 * `go-exhaustruct`: from 2.2.2 to 2.3.0 * `gopsutil`: from 3.22.6 to 3.22.7 * `gosec`: from 2.12.0 to 2.13.1 * `revive`: from 1.2.1 to 1.2.3 * `usestdlibvars`: from 1.8.0 to 1.13.0 * `contextcheck`: from v1.0.4 to v1.0.6 && re-enable * `nosnakecase`: This linter is deprecated. * `varcheck`: This linter is deprecated use `unused` instead. * `deadcode`: This linter is deprecated use `unused` instead. * `structcheck`: This linter is deprecated use `unused` instead. 3. documentation * `revive`: fix wrong URL * Add a section about default exclusions * `usestdlibvars`: fix typo in documentation * `nolintlint`: remove allow-leading-space option * Update documentation and assets 4. misc. * dev: rewrite the internal tests framework * fix: exit early on run --version * fix: set an explicit `GOROOT` in the Docker image for `go-critic` ### v1.48.0 _Released on 2022-08-04_ 1. new linters * `usestdlibvars`:https://github.com/sashamelentyev/usestdlibvars 2. updated linters * `contextcheck`: disable linter * `errcheck`: from 1.6.1 to 1.6.2 * `gci`: add missing `custom-order` setting * `gci`: from 0.5.0 to 0.6.0 * `ifshort`: deprecate linter * `nolint`: drop allow-leading-space option and add "nolint:all" * `revgrep`: bump to HEAD 3. documentation * remove outdated info on source install 4. misc * go1.19 support ### v1.47.3 _Released on 2022-08-01_ 1. updated linters: * remove some go1.18 limitations * `asasalint`: from 0.0.10 to 0.0.11 * `decorder`: from 0.2.2 to v0.2.3 * `gci`: fix panic with invalid configuration option * `gci`: from 0.4.3 to v0.5.0 * `go-exhaustruct`: from 2.2.0 to 2.2.2 * `gomodguard`: from 1.2.3 to 1.2.4 * `nosnakecase`: from 1.5.0 to 1.7.0 * `honnef.co/go/tools`: from 0.3.2 to v0.3.3 2. misc * cgo: fix linters ignoring CGo files ### v1.47.2 _Released on 2022-07-21_ 1. updated linters: * `revive`: ignore slow rules ### v1.47.1 _Released on 2022-07-19_ 1. updated linters: * `gci`: from 0.4.2 to 0.4.3 * `gci`: remove the use of stdin * `gci`: fix options display * `tenv`: from 1.6.0 to 1.7.0 * `unparam`: bump to HEAD ### v1.47.0 _Released on 2022-07-18_ 1. new linters: * `asasalint`: https://github.com/alingse/asasalint * `nosnakecase`: https://github.com/sivchari/nosnakecase 2. updated linters: * `decorder`: from 0.2.1 to 0.2.2 * `errcheck`: from 1.6.0 to 1.6.1 * `errname`: from 0.1.6 to 0.1.7 * `exhaustive`: from 0.7.11 to 0.8.1 * `gci`: fix issues and re-enable autofix * `gci`: from 0.3.4 to 0.4.2 * `go-exhaustruct`: from 2.1.0 to 2.2.0 * `go-ruleguard`: from 0.3.19 to 0.3.21 * `gocognit`: from 1.0.5 to 1.0.6 * `gocyclo`: from 0.5.1 to 0.6.0 * `golang.org/x/tools`: bump to HEAD * `gosec`: allow `global` config * `gosec`: from 2.11.0 to 2.12.0 * `nonamedreturns`: from 1.0.1 to 1.0.4 * `paralleltest`: from 1.0.3 to 1.0.6 * `staticcheck`: fix generics * `staticcheck`: from 0.3.1 to 0.3.2 * `tenv`: from 1.5.0 to 1.6.0 * `testpackage`: from 1.0.1 to 1.1.0 * `thelper`: from 0.6.2 to 0.6.3 * `wrapcheck`: from 2.6.1 to 2.6.2 3. documentation: * add thanks page * add a clear explanation about the `staticcheck` integration. * `depguard`: add `ignore-file-rules` * `depguard`: adjust phrasing * `gocritic`: add `enable` and `disable` ruleguard settings * `gomnd`: fix typo * `gosec`: add configs for all existing rules * `govet`: add settings for `shadow` and `unusedresult` * `thelper`: add `fuzz` config and description * linters: add defaults ### v1.46.2 _Released on 2022-05-17_ 1. updated linters: * `execinquery`: bump from v1.2.0 to v1.2.1 * `errorlint`: bump to v1.0.0 * `thelper`: allow to disable one option 2. documentation: * rename `.golangci.example.yml` to `.golangci.reference.yml` * add `containedctx` linter to the list of available linters ### v1.46.1 _Released on 2022-05-12_ 1. updated linters: * `execinquery`: bump from v0.6.0 to v0.6.1 2. documentation: * add missing linters ### v1.46.0 _Released on 2022-05-09_ 1. new linters: * `execinquery`: https://github.com/lufeee/execinquery * `nonamedreturns`: https://github.com/firefart/nonamedreturns * `nosprintfhostport`: https://github.com/stbenjam/no-sprintf-host-port * `exhaustruct`: https://github.com/GaijinEntertainment/go-exhaustruct 2. updated linters: * `bidichk`: from 0.2.2 to 0.2.3 * `deadcode`: bump to HEAD * `errchkjson`: from 0.2.3 to 0.3.0 * `errname`: from 0.1.5 to 0.1.6 * `go-critic`: from 0.6.2 to 0.6.3 * `gocyclo`: from 0.4.0 to 0.5.1 * `gofumpt` from 0.3.0 to 0.3.1 * `gomoddirectives`: from 0.2.2 to 0.2.3 * `gosec`: from 2.10.0 to 2.11.0 * `honnef.co/go/tools`: from 0.2.2to 0.3.1 (go1.18 support) * `nilnil`: from 0.1.0 to 0.1.1 * `nonamedreturns`: bump from 1.0.0 to 1.0.1 * `predeclared`: from 0.2.1 to 0.2.2 * `promlinter`: bump to v0.2.0 * `revive`: from 1.1.4 to 1.2.1 * `tenv`: from 1.4.7 to 1.5.0 * `thelper`: from 0.5.1 to 0.6.2 * `unused`: fix false-positive * `varnamelen`: bump to v0.8.0 * `wrapcheck`: from 2.5.0 to 2.6.1 * `exhaustivestruct`: This linter is deprecated use `exhaustruct` instead. 3. documentation: * Update "Shell Completion" instruction on Linux * Update FAQ page 4. misc: * log: enable override coloring based on `CLICOLOR` and `CLICOLOR_FORCE` ### v1.45.2 _Released on 2022-03-24_ 1. misc: * fix: help command ### v1.45.1 _Released on 2022-03-24_ 1. updated linters: * `interfacer`: inactivate with go1.18 * `govet`: inactivate unsupported analyzers (go1.18) * `depguard`: reduce requirements * `structcheck`: inactivate with go1.18 * `varnamelen`: bump from v0.6.0 to v0.6.1 2. misc: * Automatic Go version detection 🎉 (go1.18) * docker: update base images (go1.18) ### v1.45.0 _Released on 2022-03-29_ 1. updated linters: * `cobra`: from 1.3.0 to 1.4.0 * `containedctx`: from 1.0.1 to 1.0.2 * `errcheck`: add an option to remove default exclusions * `gci`: from 0.3.1 to 0.3.2 * `go-header`: from 0.4.2 to 0.4.3 * `gofumpt`: add module-path setting * `gofumpt`: from 0.2.1 to 0.3.0 * `gopsutil`: from 3.22.1 to 3.22.2 * `gosec`: from 2.9.6 to 2.10.0 * `makezero`: from 1.1.0 to 1.1.1 * `revive`: fix default values * `wrapcheck`: from 2.4.0 to 2.5.0 2. documentation: * docs: add "back to the top" button * docs: add `forbidigo` example that uses comments * docs: improve linters page 3. misc: * go1.18 support 🎉 * Add an option to manage the targeted version of Go * Default to YAML when config file has no extension ### v1.44.2 _Released on 2022-02-17_ 1. updated linters: * `gci`: bump to HEAD * `gci`: restore defaults for sections * `whitespace`: from 0.0.4 to 0.0.5 2. documentation: * add link to configuration in the linters list ### v1.44.1 _Released on 2022-02-17_ 1. updated linters: * `bidichk`: from 0.2.1 to 0.2.2 * `errchkjson`: from 0.2.1 to 0.2.3 * `thelper`: from 0.5.0 to 0.5.1 * `tagliatelle`: from 0.3.0 to 0.3.1 * `gopsutil`: from 3.21.12 to 3.22.1 * `gci`: from 0.2.9 to 0.3.0 * `revive`: from v1.1.3 to v1.1.4 * `varnamelen`: from v0.5.0 to v0.6.0 2. documentation: * linters: improve configuration pages * `decorder`: fix `disable-init-func-first-check: false` elaboration 3. misc: * fix debug output ### v1.44.0 _Released on 2022-01-25_ 1. new linters: * `containedctx`: https://github.com/sivchari/containedctx * `decorder`: https://gitlab.com/bosi/decorder * `errchkjson`: https://github.com/breml/errchkjson * `maintidx`: https://github.com/yagipy/maintidx * `grouper`: https://github.com/leonklingele/grouper 2. updated linters: * `asciicheck`: bump to v0.1.1 * `bidichk`: from 0.1.1 to 0.2.1 * `bodyclose`: bump to HEAD * `decorder`: from 0.2.0 to 0.2.1 * `depguard`: from 1.0.1 to 1.1.0 * `errchkjson`: from 0.2.0 to 0.2.1 * `errorlint`: bump to HEAD * `exhaustive`: drop deprecated/unused settings * `exhaustive`: from v0.2.3 to 0.7.11 * `forbidigo`: from 1.2.0 to 1.3.0 * `forcetypeassert`: bump to v0.1.0 * `gocritic`: from 0.6.1 to 0.6.2 * `gocritic`: support autofix * `gocyclo`: from 0.3.1 to 0.4.0 * `godot`: add period option * `gofumpt`: from 0.1.1 to 0.2.1 * `gomnd`: from 2.4.0 to 2.5.0 * `gomnd`: new configuration * `gosec`: from 2.9.1 to 2.9.6 * `ifshort`: from 1.0.3 to 1.0.4 * `ineffassign`: bump to HEAD * `makezero`: to v1.1.0 * `promlinter`: from v0.1.0 to HEAD * `revive`: fix `enableAllRules` * `revive`: from 1.1.2 to 1.1.3 * `staticcheck`: from 0.2.1 to 0.2.2 * `tagliatelle`: from 0.2.0 to 0.3.0 * `thelper`: from 0.4.0 to 0.5.0 * `unparam`: bump to HEAD * `varnamelen`: bump to v0.5.0 * `wrapcheck`: update configuration to include `ignoreSignRegexps` 3. documentation: * linters: improve pages about configuration * improve page about false-positive * `nolintlint`: fix wrong default value in comment * `revive`: add a more detailed configuration 4. misc: * outputs: Add support for multiple outputs * outputs: Print error text in `` tag content for more readable JUnit output * outputs: ensure that the Issues key in JSON format is a list * Return error if any linter fails to run * cli: Show deprecated mark in the CLI linters help ### November 2021 1. new linters: * `bidichk`: https://github.com/breml/bidichk 2. update linters: * `nestif`: from 0.3.0 to 0.3.1 * `rowserrcheck`: from 1.1.0 to 1.1.1 * `gopsutil`: from 3.21.9 to 3.21.10 * `wrapcheck`: from 2.3.1 to 2.4.0 * `gocritic`: add support for variable substitution in `ruleguard` path settings 3. documentation: * improve `go-critic` documentation * improve `nolintlint` documentation 4. Misc: * cli: don't hide `enable-all` option ### october 2021 1. new linters: * `contextcheck`: https://github.com/kkHAIKE/contextcheck * `varnamelen`: https://github.com/blizzy78/varnamelen 2. update linters: * `gochecknoglobals`: to v0.1.0 * `gosec`: filter issues according to the severity and confidence * `errcheck`: empty selector name. * `ifshort`: from 1.0.2 to 1.0.3 * `go-critic`: from 0.5.6 to 0.6.0 * `gosec`: from 2.8.1 to 2.9.1 * `durationcheck`: from 0.0.8 to 0.0.9 * `wrapcheck`: from 2.3.0 to 2.3.1 * `revive`: from 1.1.1 to 1.1.2 ### September 2021 1. new linters: * `ireturn`: https://github.com/butuzov/ireturn * `nilnil`: https://github.com/Antonboom/nilnil * `tenv`: https://github.com/sivchari/tenv 2. update linters: * `errcheck`: update to HEAD * `errname`: from 0.1.4 to 0.1.5 * `gci`: Parse the settings more similarly to the CLI * `godot`: from 1.4.9 to 1.4.11 * `ireturn`: from 0.1.0 to 0.1.1 * `nlreturn`: add block-size option * `paralleltest`: from 1.0.2 to 1.0.3 3. Misc: * new-from-rev: add support for finding issues in entire files in a diff ### August 2021 1. new linters: * `errname`: https://github.com/Antonboom/errname 2. update linters: * `errname`: from 0.1.3 to 0.1.4 * `go-critic`: fix invalid type conversions. * `godot`: from 1.4.8 to 1.4.9 * `gomodguard`: from 1.2.2 to 1.2.3 * `revive`: from 1.0.9 to 1.1.1 * `staticcheck`: bump to 2021.1.1 (v0.2.1) * `wrapcheck`: bump to v2.3.0 3. Misc: * build binaries and Docker images with go1.17 ### July 2021 1. update linters: * `errcheck`: allow exclude config without extra file * `exhaustive`: from 0.1.0 to 0.2.3 * `gocognit`: from 1.0.1 to 1.0.5 * `godot`: from 1.4.7 to 1.4.8 * `gomoddirectives`: from 0.2.1 to 0.2.2 * `revive`: from 1.0.8 to 1.0.9 2. documentation: * improve `goconst` documentation * improve `goimports` description ### June 2021 1. update linters: * `durationcheck`: from 0.0.7 to 0.0.8 * `gci`: from 0.2.8 to 0.2.9 * `goconst`: from 0.5.6 to 0.5.7 * `gofumpt`: Add lang-version option * `gomodguard`: from 1.2.1 to 1.2.2 * `gosec`: from 2.8.0 to 2.8.1 * `revive`: add enable-all-rules. * `revive`: allow to disable rule * `revive`: fix exclude comment rule for const block * `revive`: from 1.0.7 to 1.0.8 * `wrapcheck`: from 2.1.0 to 2.2.0 2. documentation: * add all integrations to docs introduction page 3. Misc: * 🎉 Un-deprecate enable-all option * output: generate HTML report * Support RISV64 ### May 2021 1. new linters: * `tagliatelle`: https://github.com/ldez/tagliatelle * `promlinter`: https://github.com/yeya24/promlinter 2. update linters: * `durationcheck`: from 0.0.6 to 0.0.7 * `errorlint`: bump to HEAD * `forbidigo`: from 1.1.0 to 1.2.0 * `go-critic`: from 0.5.5 to 0.5.6 * `godot`: from 1.4.6 to 1.4.7 * ⚠ `golint`: deprecated * `gomnd`: from 2.3.2 to 2.4.0 * `gomodguard`: fix problem where duplicate issues were reported * `gosec`: from 2.7.0 to 2.8.0 * `govet`: fix `sigchanyzer` * `govet`: Update vet passes * `importas`: allow repeated aliases * `importas`: bump to HEAD * `makezero`: bump to HEAD * `nolintlint`: fix false positive * `revive`: convert hard coded excludes into default exclude patterns * `revive`: fix add-constant rule support * `revive`: fix excludes * `revive`: from 1.0.6 to 1.0.7 * `revive`: improve 'exported' rule output * `rowserrcheck`: bump to v1.1.0 * `staticcheck`: configuration for `staticcheck`, `gosimple`, `stylecheck` * `staticcheck`: from 0.1.3 to 0.1.4 * `staticcheck`: from v0.1.4 to v0.2.0 * `wastedassign`: from 0.2.0 to 1.0.0 * `wastedassign`: from 1.0.0 to v2.0.6 * `wrapcheck`: from 1.2.0 to 2.1.0 3. documentation: * improve linters page * `exhaustivestruct` example explanation * fix pattern of `forbidigo` in example config yaml * bump documentation dependencies * fix typos 4. Misc: * set the minimum Go version to go1.15 * non-zero exit code when a linter produces a panic ### April 2021 1. new linters: * `tagliatelle`: https://github.com/ldez/tagliatelle * `promlinter`: https://github.com/yeya24/promlinter 2. update linters: * `godot`: from 1.4.4 to 1.4.6 * `wrapcheck`: from 1.0.0 to 1.2.0 * `go-mnd`: from 2.3.1 to 2.3.2 * `wsl`: from 3.2.0 to 3.3.0 * `revive`: from 1.0.5 to 1.0.6 * `importas`: bump to HEAD * `staticcheck`: configurable Go version * `gosec`: add configuration * `typecheck`: improve error stack parsing 3. documentation: * bump documentation dependencies * fix typos 4. Misc: * fix: comma in exclude pattern leads to unexpected results ### March 2021 1. new linters: * `gomoddirectives`: https://github.com/ldez/gomoddirectives 2. update linters: * `go-critic`: from 0.5.4 to 0.5.5 * `gofumpt`: from v0.1.0 to v0.1.1 * `gosec`: from 2.6.1 to 2.7.0 * `ifshort`: bump to v1.0.2 * `importas`: bump to HEAD * `makezero`: bump to HEAD * `nolintlint`: allow to fix //nolint lines * `revive`: from 1.0.3 to 1.0.5 * `revive`: the default configuration is only applied when no dedicated configuration * `rowserrcheck`: bump to HEAD * ⚠ `scopelint`: deprecated * `staticcheck`: from v0.1.2 (2020.2.2) to v0.1.3 (2020.2.3) * 🎉 `typecheck`: display compilation errors as report instead of error * `wastedassign`: bump to v0.2.0 * `wrapcheck`: bump to v1.0.0 3. documentation: * improve [linters page](https://golangci-lint.run/docs/linters/) (versions, deprecation, and presets) * add [cache directory](https://golangci-lint.run/docs/configuration/cli/#cache) information * adding missing format options * fix typos 4. Misc: * Set `version` command output to Stdout * fix linters load mode * Restore fast linters meaning ### February 2021 1. new linters: * `durationcheck`: https://github.com/charithe/durationcheck * `revive`: https://github.com/mgechev/revive * `cyclop`: https://github.com/bkielbasa/cyclop * `wastedassign`: https://github.com/sanposhiho/wastedassign * `importas`: https://github.com/julz/importas * `nilerr`: https://github.com/gostaticanalysis/nilerr * `forcetypeassert`: https://github.com/gostaticanalysis/forcetypeassert * `govet`: add `stringintconv` and `ifaceassert` 2. update linters: * `prealloc`: Use upstream version * `errcheck`: Use upstream version * `ineffassign`: Use upstream version * `gocyclo`: Use upstream version * `godot` from 1.3.2 to 1.4.3 * `exhaustivestruct` from 1.1.0 to 1.2.0 * `forbidigo` from 1.0.0 to 1.1.0 * `thelper` from 0.2.1 to 0.3.1 * `ruleguard`: print error message and exit with non-zero status when parsing error occurs * fix wrong load mode for `asciicheck`, `exhaustivestruct`, `exportloopref`, and `makezero` * `wsl`: bump to v3.2.0 * `durationcheck`: from 0.0.4 to 0.0.6 * `staticcheck`: from 2020.1.6 to v0.1.2 (2020.2.2) * `thelper` from 0.3.1 to 0.4.0 * `bodyclose`: bump to HEAD * `go-err113`: bump to HEAD * ⚠ `interfacer`: deprecated * ⚠ `maligned`: deprecated (govet `fieldalignment` as replacement) * `govet`: use same default linter as go vet * `go-printf-func-name`: to `v0.0.0-20200119135958-7558a9eaa5af` * `godox`: to `v0.0.0-20210227103229-6504466cf951` * `asciicheck`: to `v0.0.0-20200416200610-e657995f937b` * `wrapcheck`: to `v0.0.0-20201130113247-1683564d9756` * `unparam`: to `v0.0.0-20210104141923-aac4ce9116a7` 3. CLI: truncate multiline descriptions 4. fix: new-from-rev for a large repository 5. Support RelatedInformation for analysis Diagnostic 6. use go1.16 to create binaries 7. fix: MIPS release 8. documentation: * bump documentation dependencies * fix `go-header` usage * improve `gocritic` description * update deprecated hyperlink for Sublime Text plugin * add docs on using homebrew tap ### January 2021 1. new linters: * `predeclared`: https://github.com/nishanths/predeclared * `ifshort`: https://github.com/esimonov/ifshort 2. update linters: * `go-critic` from 0.5.2 to 0.5.3 * `thelper` from 0.1.0 to 0.2.1 * Validate `go-critic` settings * `gofumpt` to v0.1.0 * `gci` to v0.2.8 * `go-mnd` to v2.3.1 * `gosec` from 2.5.0 to 2.6.1 * `godot` from 1.3.2 to 1.4.3 * `ifshort` to v1.0.1 * `rowserrcheck`: fix reports false positive 3. fix: modules-download-mode support 4. documentation: * bump documentation dependencies ### December 2020 1. new linters: * `forbidigo`: https://github.com/ashanbrown/forbidigo * `makezero`: https://github.com/ashanbrown/makezero * `thelper`: https://github.com/kulti/thelper 2. update linters: * `go-header` from v0.3.1 to v0.4.2 * `go-mnd` from v2.0.0 to v2.2.0 * `godot` from v1.3.0 to v1.3.2 * `gci` from v0.2.4 to v0.2.7 * `gomodguard` from v1.1.0 to v1.2.0 * `go-errorlint` from v0.0.0-20201006195004-351e25ade6e3 to v0.0.0-20201127212506-19bd8db6546f * `gofumpt` from v0.0.0-20200802201014-ab5a8192947d to v0.0.0-20201129102820-5c11c50e9475 * `nolintlint` fix comment analysis. (#1571) 3. result/processors: treat all non-Go source as special autogenerated files 4. throw an error on panic. (#1540) 5. resolve custom linters' path relative to config file directory (#1572) 6. treat all non-Go source as special autogenerated files 7. documentation: * add settings examples for `gocritic` (#1562) * removing reference to no-longer-existing linter-in-the-cloud (#1553) 8. others: * bump `gopkg.in/yaml.v2` from 2.3.0 to 2.4.0 (#1528) * bump `gatsby-remark-responsive-iframe` in /docs (#1533) * bump `gatsby-remark-images` from 3.3.29 to 3.6.0 in /docs (#1531) * bump `ini` from 1.3.5 to 1.3.8 in /tools (#1560) * bump `react-headroom` from 3.0.0 to 3.0.1 in /docs (#1532) * bump `react-live` from 2.2.2 to 2.2.3 in /docs (#1534) * bump `react` from 16.13.1 to 16.14.0 in /docs (#1481) * Fix `forbidigo` linter name in reports (#1590) ### November 2020 1. new linters: * `paralleltest`: https://github.com/kunwardeep/paralleltest 2. update linters: * `godot` from v0.4.9 to v1.3.0 * `exportloopref` from v0.1.7 to v0.1.8 * `gosec` from 2.4.0 to 2.5.0 * `goconst` using upstream https://github.com/jgautheron/goconst 3. `DefaultExcludePatterns` should only be used for specified linter (#1494) 4. unknown linter breaks //nolint (#1497) 5. report all unknown linters at once (#1477) 6. CI: * fix Docker tag for Alpine build 7. documentation: * missing sort-results in the docs (#1514) * add description of Homebrew's official formula (#1421) 8. others: * bump `golang.org/x/text` to v0.3.4 (#1293) * bump `github.com/fatih/color` to from 1.9.0 to 1.10.0 (#1485) * bump `lodash` from 4.17.15 to 4.17.19 in /.github/peril (#1252) * bump `polished` from 3.6.6 to 4.0.3 in /docs (#1482) * bump `gatsby-alias-imports` from 1.0.4 to 1.0.6 in /docs (#1479) * bump `puppeteer` from 5.3.1 to 5.4.1 in /docs (#1480) * bump `gatsby-remark-embedder` from 3.0.0 to 4.0.0 in /docs (#1478) ### October 2020 1. new linters: * `exhaustivestruct`: https://github.com/mbilski/exhaustivestruct * `go-errorlint`: https://github.com/polyfloyd/go-errorlint * `tparallel`: https://github.com/moricho/tparallel * `wrapcheck`: https://github.com/tomarrell/wrapcheck 2. update linters: * `honnef.co/go/tools` from 2020.1.5 to 2020.1.6 * `exhaustivestruct` from v1.0.1 to v1.1.0 * `exhaustive` to v0.1.0 * `gochecknoglobals`: use https://github.com/leighmcculloch/gochecknoglobals 3. add support for powershell completion (#1408) 4. add `.golangci.yaml` to list of configuration files searched on startup (#1364) 5. support for only specifying default severity (#1396) 6. documentation: * mention macports installation procedure on macOS (#1352) * sort linters (#1451) 7. CI: * add codeQL scanning (#1405) * fix version details in Docker image (#1471) * releasing docker image for arm64 (#1383) * change interval for npm to monthly (#1424) 8. others: * use tag version for cobra (#1458) * bump `nancy` to 1.0.1 (#1410) * bump `gatsby-plugin-catch-links` in /docs (#1415) * bump `gatsby-plugin-mdx` from 1.2.40 to 1.2.43 in /docs (#1419) * bump `gatsby-plugin-sharp` from 2.6.31 to 2.6.40 in /docs (#1423) * bump `gatsby-plugin-sitemap` from 2.4.12 to 2.4.14 in /docs (#1417) * bump `github.com/mattn/go-colorable` from 0.1.7 to 0.1.8 (#1413) * bump `github.com/sirupsen/logrus` from 1.6.0 to 1.7.0 (#1412) * bump `github.com/sourcegraph/go-diff` from 0.6.0 to 0.6.1 (#1414) * bump `golangci/golangci-lint-action` from v2 to v2.3.0 (#1447) (#1469) * bump `puppeteer` from 3.3.0 to 5.3.1 in /docs (#1418) ### September 2020 1. update linters: * `godot` from 0.4.8 to 0.4.9 * `exhaustive` from v0.0.0-20200708172631-8866003e3856 to v0.0.0-20200811152831-6cf413ae40e0 * `gofumpt` from v0.0.0-20200709182408-4fd085cb6d5f to v0.0.0-20200802201014-ab5a8192947d 2. add support for fish completion (#1201) 3. documentation: * fix typo in performance docs (#1350) 4. CI: * prevent macos to be marked as passing upon failure (#1381) * check only for go.mod file (#1397) * check if go.mod and go.sum are up to dated (#1377) * trigger Netlify (#1358) 5. others: * bump `github.com/sourcegraph/go-diff` from 0.5.3 to 0.6.0 (#1353) * bump `github.com/valyala/quicktemplate` from 1.6.2 to 1.6.3 (#1385) * ignore known dependency failure in nancy (#1378) * bump `@mdx-js/mdx` from 1.6.16 to 1.6.18 in /docs (#1401) * bump `gatsby` from 2.24.52 to 2.24.65 in /docs (#1400) * bump `gatsby-plugin-canonical-urls` in /docs (#1390) * bump `gatsby-plugin-google-analytics` in /docs (#1388) * bump `gatsby-plugin-manifest` from 2.4.23 to 2.4.27 in /docs (#1355) * bump `gatsby-plugin-mdx` from 1.2.35 to 1.2.40 in /docs (#1386) * bump `gatsby-plugin-offline` from 3.2.23 to 3.2.27 in /docs (#1368) * bump `gatsby-plugin-sharp` from 2.6.25 to 2.6.31 in /docs (#1354) * bump `gatsby-plugin-sitemap` from 2.4.11 to 2.4.12 in /docs (#1344) * bump `gatsby-remark-autolink-headers` in /docs (#1387) * bump `gatsby-remark-images` from 3.3.25 to 3.3.28 in /docs (#1345) * bump `gatsby-remark-images` from 3.3.28 to 3.3.29 in /docs (#1365) * bump `gatsby-remark-mermaid` from 2.0.0 to 2.1.0 in /docs (#1369) * bump `gatsby-source-filesystem` in /docs (#1366) * bump `gatsby-source-filesystem` in /docs (#1389) * bump `gatsby-transformer-sharp` in /docs (#1402) * bump `gatsby-transformer-yaml` from 2.4.10 to 2.4.11 in /docs (#1367) * bump `node-fetch` in /.github/contributors (#1363) * bump `polished` from 3.6.5 to 3.6.6 in /docs (#1347) ### August 2020 1. new `nlreturn` linter: https://github.com/ssgreg/nlreturn 2. new `gci` linter: https://github.com/daixiang0/gci 3. support `latest` version of golangci-lint in golangci-lint-action 4. update `gosec` linter from 2.3.0 to 2.4.0 5. update `godot` linter from 0.4.2 to 0.4.8 6. update `go-critic` from 0.5.0 to 0.5.2 (#1307) 7. update `nlreturn` from 2.0.1 to 2.0.2 (#1287), 2.0.2 to 2.1.0 (#1327) 8. update `gci` to v0.2.1 (#1292), to v0.2.2 (#1305), to v0.2.4 (#1337), 9. update `funlen` from 0.0.2 to 0.0.3 (#1341) 10. upgrade to golang 1.15 for smaller binary (#1303) 11. support short and json formats for version cmd (#1315) 12. add home directory to config file search paths (#1325) 13. allow for serializing multiple golangci-lint invocations (#1302) ### July 2020 1. `gofumpt` linter: * update linter * add `extra-rules` option * support auto-fixing 2. upgrade `exhaustive` linter 3. upgrade `exportloopref` linter 4. improve 'no such linter' error message 5. sorting result.Issues implementation 6. enhancements in CI: * Run `nancy` validation for all dependencies * Move dependabot config to `.github` folder 7. other * bump `lodash` from 4.17.15 to 4.17.19 in /tools * bump `golangci/golangci-lint-action` from v1.2.2 to v2 * bump `github.com/valyala/quicktemplate` from 1.5.0 to 1.5.1 ### June 2020 1. Add new linters: `gofumpt` ### May 2020 1. Add new linters: `nolintlint`, `goerr113` 2. Updated linters: `godot`, `staticcheck` 3. Launch a [website](https://golangci-lint.run) ### April 2020 1. Add new linters: `testpackage`, `nestif`, `godot`, `gomodguard`, `asciicheck` 2. Add GitHub Actions output format 3. Update linters: `wsl`, `gomodguard`, `gosec` 4. Support `disabled-tags` setting for `gocritic` 5. Mitigate OOM and "failed prerequisites" 6. Self-isolate due to unexpected pandemics 7. Support case-sensitive excludes 8. Allow granular re-enabling excludes by ID, e.g. `EXC0002` ### September 2019 1. Support go1.13 2. Add new linters: `funlen`, `whitespace` (with auto-fix) and `godox` 3. Update linters: `gochecknoglobals`, `scopelint`, `gosec` 4. Provide pre-built binary for ARM and FreeBSD 5. Fix false-positives in `unused` 6. Support `--skip-dirs-use-default` 7. Add support for bash completions ### July 2019 1. Fix parallel writes race condition 2. Update bodyclose with fixed panic ### June 2019 1. Treat Go source files as a plain text by `misspell`: it allows detecting issues in strings, variable names, etc. 2. Implement richer and more stable auto-fix of `misspell` issues. ### May 2019 1. Add [bodyclose](https://github.com/timakin/bodyclose) linter. 2. Support junit-xml output. ### April 2019 1. Update go-critic, new checkers were added: badCall, dupImports, evalOrder, newDeref 2. Fix staticcheck panic on packages that do not compile 3. Make install script work on Windows 4. Fix compatibility with the latest x/tools version and update golang.org/x/tools 5. Correct import path of module sourcegraph/go-diff 6. Fix `max-issues-per-linter` name 7. Fix linting of preprocessed files (e.g. `*.qtpl.go`, goyacc) 8. Enable auto-fixing when running via pre-commit ### March 2019 1. Support the newest `go vet` (with `go/analysis`) 2. Support configuration of `go vet`: e.g. you can set print functions by `linters-settings.govet.settings.printf.funcs` 3. Update megacheck (staticcheck) to 2019.1.1 4. Add [information](https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint) about controlling space-time trade-off into README 5. Exclude issues by source code line regexp by `issues.exclude-rules[i].source` 6. Build and test on go 1.12 7. Support `--color` option 8. Update x/tools to fix c++ issues 9. Include support for log level 10. Sort linters list in help commands ================================================ FILE: CHANGELOG.md ================================================ Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) and on [Bluesky](https://bsky.app/profile/golangci-lint.run). `golangci-lint` is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! [![Donate](https://img.shields.io/badge/Donate-❤️-blue?style=for-the-badge)](https://donate.golangci.org) ### v2.11.3 _Released on 2026-03-10_ 1. Linters bug fixes * `gosec`: from v2.24.7 to 619ce2117e08 ### v2.11.2 _Released on 2026-03-07_ 1. Fixes * `fmt`: fix error when using the `fmt` command with explicit paths. ### v2.11.1 _Released on 2026-03-06_ Due to an error related to AUR, some artifacts of the v2.11.0 release have not been published. This release contains the same things as v2.11.0. ### v2.11.0 _Released on 2026-03-06_ 1. Linters new features or changes * `errcheck`: from 1.9.0 to 1.10.0 (exclude `crypto/rand.Read` by default) * `gosec`: from 2.23.0 to 2.24.6 (new rules: `G113`, `G118`, `G119`, `G120`, `G121`, `G122`, `G123`, `G408`, `G707`) * `noctx`: from 0.4.0 to 0.5.0 (new detection: `httptest.NewRequestWithContext`) * `prealloc`: from 1.0.2 to 1.1.0 * `revive`: from 1.14.0 to 1.15.0 (⚠️ Breaking change: package-related checks moved from `var-naming` to a new rule `package-naming`) 2. Linters bug fixes * `gocognit`: from 1.2.0 to 1.2.1 * `gosec`: from 2.24.6 to 2.24.7 * `unqueryvet`: from 1.5.3 to 1.5.4 ### v2.10.1 _Released on 2026-02-17_ 1. Fixes * buildssa panic ### v2.10.0 _Released on 2026-02-17_ 1. Linters new features or changes * `ginkgolinter`: from 0.22.0 to 0.23.0 * `gosec`: from 2.22.11 to 2.23.0 (new rules: `G117`, `G602`, `G701`, `G702`, `G703`, `G704`, `G705`, `G706`) * `staticcheck`: from 0.6.1 to 0.7.0 2. Linters bug fixes * `godoclint`: from 0.11.1 to 0.11.2 ### v2.9.0 _Released on 2026-02-10_ 1. Enhancements * 🎉 go1.26 support 2. Linters new features or changes * `arangolint`: from 0.3.1 to 0.4.0 (new rule: detect potential query injections) * `ginkgolinter`: from 0.21.2 to 0.22.0 (support for wrappers) * `golines`: from 0.14.0 to 0.15.0 * `misspell`: from 0.7.0 to 0.8.0 * `revive`: from v1.13.0 to v1.14.0 (new rules: `epoch-naming`, `use-slices-sort`) * `unqueryvet`: from 1.4.0 to 1.5.3 (new options: `check-n1`, `check-sql-injection`, `check-tx-leaks`, `allow`, `custom-rules`) * `wsl_v5`: from 5.3.0 to 5.6.0 (new rule: `after-block`) 3. Linters bug fixes * `modernize`: from 0.41.0 to 0.42.0 * `prealloc`: from 1.0.1 to 1.0.2 * `protogetter`: from 0.3.18 to 0.3.20 4. Misc. * Log information about files when configuration verification * Emit an error when no linters enabled * Do not collect VCS information when loading code ### v2.8.0 _Released on 2026-01-07_ 1. Linters new features or changes * `godoclint`: from 0.10.2 to 0.11.1 (new rule: `require-stdlib-doclink`) * `golines`: from 442fd0091d95 to 0.14.0 * `gomoddirectives`: from 0.7.1 to 0.8.0 * `gosec`: from daccba6b93d7 to 2.22.11 (new rule: `G116`) * `modernize`: from 0.39.0 to 0.40.0 (new analyzers: `stringscut`, `unsafefuncs`) * `prealloc`: from 1.0.0 to 1.0.1 (message changes) * `unqueryvet`: from 1.3.0 to 1.4.0 (new options: `check-aliased-wildcard`, `check-string-concat`, `check-format-strings`, `check-string-builder`, `check-subqueries`, `ignored-functions`, `sql-builders`) 2. Linters bug fixes * `gocritic`: from 0.14.2 to 0.14.3 * `errorlint`: from 1.8.0 to 1.9.0 * `govet`: from 0.39.0 to 0.40.0 * `protogetter`: from 0.3.17 to 0.3.18 * `revive`: add missing enable-default-rules setting 3. Documentation * docs: split installation page ### v2.7.2 _Released on 2025-12-07_ 1. Linter bug fixes * `gosec`: from 2.22.10 to daccba6b93d7 ### v2.7.1 _Released on 2025-12-04_ 1. Linter bug fixes * `modernize`: disable `stringscut` analyzer ### v2.7.0 _Released on 2025-12-03_ 1. Bug fixes * fix: clone args used by `custom` command 2. Linters new features or changes * `nosprintfhostport`: from 0.2.0 to 0.3.1 (ignore string literals without a colon) * `unqueryvet`: from 1.2.1 to 1.3.0 (handles `const` and `var` declarations) * `revive`: from 1.12.0 to 1.13.0 (new option: `enable-default-rules`, new rules: `forbidden-call-in-wg-go`, `unnecessary-if`, `inefficient-map-lookup`) * `modernize`: from 0.38.0 to 0.39.0 (new analyzers: `plusbuild`, `stringscut`) 3. Linters bug fixes * `perfsprint`: from 0.10.0 to 0.10.1 * `wrapcheck`: from 2.11.0 to 2.12.0 * `godoclint`: from 0.10.1 to 0.10.2 4. Misc. * Add some flags to the `custom` command 5. Documentation * docs: split changelog v1 and v2 ### v2.6.2 _Released on 2025-11-14_ 1. Bug fixes * `fmt` command with symlinks * use file depending on build configuration to invalidate cache 2. Linters bug fixes * `testableexamples`: from 1.0.0 to 1.0.1 * `testpackage`: from 1.1.1 to 1.1.2 ### v2.6.1 _Released on 2025-11-04_ 1. Linters bug fixes * `copyloopvar`: from 1.2.1 to 1.2.2 * `gocritic`: from 0.14.0 to 0.14.2 ### v2.6.0 _Released on 2025-10-29_ 1. New linters * Add `modernize` analyzer suite 2. Linters new features or changes * `arangolint`: from 0.2.0 to 0.3.1 * `dupword`: from 0.1.6 to 0.1.7 (new option `comments-only`) * `gocritic`: from 0.13.0 to 0.14.0 (new rules/checkers: `zeroByteRepeat`, `dupOption`) * `gofumpt`: from 0.9.1 to 0.9.2 ("clothe" naked returns is now controlled by the `extra-rules` option) * `perfsprint`: from 0.9.1 to 0.10.0 (new options: `concat-loop`, `loop-other-ops`) * `wsl`: from 5.2.0 to 5.3.0 3. Linters bug fixes * `dupword`: from 0.1.6 to 0.1.7 * `durationcheck`: from 0.0.10 to 0.0.11 * `exptostd`: from 0.4.4 to 0.4.5 * `fatcontext`: from 0.8.1 to 0.9.0 * `forbidigo`: from 2.1.0 to 2.3.0 * `ginkgolinter`: from 0.21.0 to 0.21.2 * `godoclint`: from 0.10.0 to 0.10.1 * `gomoddirectives`: from 0.7.0 to 0.7.1 * `gosec`: from 2.22.8 to 2.22.10 * `makezero`: from 2.0.1 to 2.1.0 * `nilerr`: from 0.1.1 to 0.1.2 * `paralleltest`: from 1.0.14 to 1.0.15 * `protogetter`: from 0.3.16 to 0.3.17 * `unparam`: from 0df0534333a4 to 5beb8c8f8f15 4. Misc. * fix: ignore some files to hash the version for custom build ### v2.5.0 _Released on 2025-09-21_ 1. New linters * Add `godoclint` linter https://github.com/godoc-lint/godoc-lint * Add `unqueryvet` linter https://github.com/MirrexOne/unqueryvet * Add `iotamixing` linter https://github.com/AdminBenni/iota-mixing 2. Linters new features or changes * `embeddedstructfieldcheck`: from 0.3.0 to 0.4.0 (new option: `empty-line`) * `err113`: from aea10b59be24 to 0.1.1 (skip internals of `Is` methods for `error` type) * `ginkgolinter`: from 0.20.0 to 0.21.0 (new option: `force-tonot`) * `gofumpt`: from 0.8.0 to 0.9.1 (new rule is to "clothe" naked returns for the sake of clarity) * `ineffassign`: from 0.1.0 to 0.2.0 (new option: `check-escaping-errors`) * `musttag`: from 0.13.1 to 0.14.0 (support interface methods) * `revive`: from 1.11.0 to 1.12.0 (new options: `identical-ifelseif-branches`, `identical-ifelseif-conditions`, `identical-switch-branches`, `identical-switch-conditions`, `package-directory-mismatch`, `unsecure-url-scheme`, `use-waitgroup-go`, `useless-fallthrough`) * `thelper`: from 0.6.3 to 0.7.1 (skip `t.Helper` in functions passed to `synctest.Test`) * `wsl_v5`: from 5.1.1 to 5.2.0 (improvements related to subexpressions) 3. Linters bug fixes * `asciicheck`: from 0.4.1 to 0.5.0 * `errname`: from 1.1.0 to 1.1.1 * `fatcontext`: from 0.8.0 to 0.8.1 * `goprintffuncname`: from 0.1.0 to 0.1.1 * `godot`: from 1.5.1 to 1.5.4 * `gosec`: from 2.22.7 to 2.22.8 * `nilerr`: from 0.1.1 to a temporary fork * `nilnil`: from 1.1.0 to 1.1.1 * `protogetter`: from 0.3.15 to 0.3.16 * `tagliatelle`: from 0.7.1 to 0.7.2 * `testifylint`: from 1.6.1 to 1.6.4 4. Misc. * fix: "no export data" errors are now handled as a standard typecheck error 5. Documentation * Improve nolint section about syntax ### v2.4.0 _Released on 2025-08-14_ 1. Enhancements * 🎉 go1.25 support 2. Linters new features or changes * `exhaustruct`: from v3.3.1 to 4.0.0 (new options: `allow-empty`, `allow-empty-rx`, `allow-empty-returns`, `allow-empty-declarations`) 3. Linters bug fixes * `godox`: trim filepath from report messages * `staticcheck`: allow empty options * `tagalign`: from 1.4.2 to 1.4.3 4. Documentation * 🌟 New website (with a search engine) ### v2.3.1 _Released on 2025-08-02_ 1. Linters bug fixes * `gci`: from 0.13.6 to 0.13.7 * `gosec`: from 2.22.6 to 2.22.7 * `noctx`: from 0.3.5 to 0.4.0 * `wsl_v5`: from 5.1.0 to 5.1.1 * tagliatelle: force upper case for custom initialisms ### v2.3.0 _Released on 2025-07-21_ 1. Linters new features or changes * `ginkgolinter`: from 0.19.1 to 0.20.0 (new option: `force-assertion-description`) * `iface`: from 1.4.0 to 1.4.1 (report message improvements) * `noctx`: from 0.3.4 to 0.3.5 (new detections: `log/slog`, `exec`, `crypto/tls`) * `revive`: from 1.10.0 to 1.11.0 (new rule: `enforce-switch-style`) * `wsl_v5`: from 5.0.0 to 5.1.0 2. Linters bug fixes * `gosec`: from 2.22.5 to 2.22.6 * `noinlineerr`: from 1.0.4 to 1.0.5 * `sloglint`: from 0.11.0 to 0.11.1 3. Misc. * fix: panic close of closed channel ### v2.2.2 _Released on 2025-07-11_ 1. Linters bug fixes * `noinlineerr`: from 1.0.3 to 1.0.4 2. Documentation * Improve debug keys documentation 3. Misc. * fix: panic close of closed channel * godot: add noinline value into the JSONSchema ### v2.2.1 _Released on 2025-06-28_ 1. Linters bug fixes * `varnamelen`: fix configuration ### v2.2.0 _Released on 2025-06-28_ 1. New linters * Add `arangolint` linter https://github.com/Crocmagnon/arangolint * Add `embeddedstructfieldcheck` linter https://github.com/manuelarte/embeddedstructfieldcheck * Add `noinlineerr` linter https://github.com/AlwxSin/noinlineerr * Add `swaggo` formatter https://github.com/golangci/swaggoswag 2. Linters new features or changes * `errcheck`: add `verbose` option * `funcorder`: from 0.2.1 to 0.5.0 (new option `alphabetical`) * `gomoddirectives`: from 0.6.1 to 0.7.0 (new option `ignore-forbidden`) * `iface`: from 1.3.1 to 1.4.0 (new option `unexported`) * `noctx`: from 0.1.0 to 0.3.3 (new report messages, and new rules related to `database/sql`) * `noctx`: from 0.3.3 to 0.3.4 (new SQL functions detection) * `revive`: from 1.9.0 to 1.10.0 (new rules: `time-date`, `unnecessary-format`, `use-fmt-print`) * `usestdlibvars`: from 1.28.0 to 1.29.0 (new option `time-date-month`) * `wsl`: deprecation * `wsl_v5`: from 4.7.0 to 5.0.0 (major version with new configuration) 3. Linters bug fixes * `dupword`: from 0.1.3 to 0.1.6 * `exptostd`: from 0.4.3 to 0.4.4 * `forbidigo`: from 1.6.0 to 2.1.0 * `gci`: consistently format the code * `spancheck`: from 0.6.4 to 0.6.5 * `goconst`: from 1.8.1 to 1.8.2 * `gosec`: from 2.22.3 to 2.22.4 * `gosec`: from 2.22.4 to 2.22.5 * `makezero`: from 1.2.0 to 2.0.1 * `misspell`: from 0.6.0 to 0.7.0 * `usetesting`: from 0.4.3 to 0.5.0 4. Misc. * exclusions: fix `path-expect` * formatters: write the input to `stdout` when using `stdin` and there are no changes * migration: improve the error message when trying to migrate a migrated config * `typecheck`: deduplicate errors * `typecheck`: stops the analysis after the first error * Deprecate `print-resources-usage` flag * Unique version per custom build 5. Documentation * Improves typecheck FAQ * Adds plugin systems recommendations * Add description for `linters.default` sets ### v2.1.6 _Released on 2025-05-04_ 1. Linters bug fixes * `godot`: from 1.5.0 to 1.5.1 * `musttag`: from 0.13.0 to 0.13.1 2. Documentation * Add note about golangci-lint v2 integration in VS Code ### v2.1.5 _Released on 2025-04-24_ Due to an error related to Snapcraft, some artifacts of the v2.1.4 release have not been published. This release contains the same things as v2.1.3. ### v2.1.4 _Released on 2025-04-24_ Due to an error related to Snapcraft, some artifacts of the v2.1.3 release have not been published. This release contains the same things as v2.1.3. ### v2.1.3 _Released on 2025-04-24_ 1. Linters bug fixes * `fatcontext`: from 0.7.2 to 0.8.0 2. Misc. * migration: fix `nakedret.max-func-lines: 0` * migration: fix order of `staticcheck` settings * fix: add `go.mod` hash to the cache salt * fix: use diagnostic position for related information position ### v2.1.2 _Released on 2025-04-15_ 1. Linters bug fixes * `exptostd`: from 0.4.2 to 0.4.3 * `gofumpt`: from 0.7.0 to 0.8.0 * `protogetter`: from 0.3.13 to 0.3.15 * `usetesting`: from 0.4.2 to 0.4.3 ### v2.1.1 _Released on 2025-04-12_ The release process of v2.1.0 failed due to a regression inside goreleaser. The binaries of v2.1.0 have been published, but not the other artifacts (AUR, Docker, etc.). ### v2.1.0 _Released on 2025-04-12_ 1. Enhancements * Add an option to display absolute paths (`--path-mode=abs`) * Add configuration path placeholder (`${config-path}`) * Add `warn-unused` option for `fmt` command * Colored diff for `fmt` command (`golangci-lint fmt --diff-colored`) 2. New linters * Add `funcorder` linter https://github.com/manuelarte/funcorder 3. Linters new features or changes * `errorlint`: from 1.7.1 to 1.8.0 (automatic error comparison and type assertion fixes) * ⚠️ `goconst`: `ignore-strings` is deprecated and replaced by `ignore-string-values` * `goconst`: from 1.7.1 to 1.8.1 (new options: `find-duplicates`, `eval-const-expressions`) * `govet`: add `httpmux` analyzer * `nilnesserr`: from 0.1.2 to 0.2.0 (detect more cases) * `paralleltest`: from 1.0.10 to 1.0.14 (checks only `_test.go` files) * `revive`: from 1.7.0 to 1.9.0 (support kebab case for setting names) * `sloglint`: from 0.9.0 to 0.11.0 (autofix, new option `msg-style`, suggest `slog.DiscardHandler`) * `wrapcheck`: from 2.10.0 to 2.11.0 (new option `report-internal-errors`) * `wsl`: from 4.6.0 to 4.7.0 (cgo files are always excluded) 4. Linters bug fixes * `fatcontext`: from 0.7.1 to 0.7.2 * `gocritic`: fix `importshadow` checker * `gosec`: from 2.22.2 to 2.22.3 * `ireturn`: from 0.3.1 to 0.4.0 * `loggercheck`: from 0.10.1 to 0.11.0 * `nakedret`: from 2.0.5 to 2.0.6 * `nonamedreturns`: from 1.0.5 to 1.0.6 * `protogetter`: from 0.3.12 to 0.3.13 * `testifylint`: from 1.6.0 to 1.6.1 * `unconvert`: update to HEAD 5. Misc. * Fixes memory leaks when using go1.(N) with golangci-lint built with go1.(N-X) * Adds `golangci-lint-fmt` pre-commit hook 6. Documentation * Improvements * Updates section about vscode integration ### v2.0.2 _Released on 2025-03-25_ 1. Misc. * Fixes flags parsing for formatters * Fixes the filepath used by the exclusion `source` option 2. Documentation * Adds a section about flags migration * Cleaning pages with v1 options ### v2.0.1 _Released on 2025-03-24_ 1. Linters/formatters bug fixes * `golines`: fix settings during linter load 2. Misc. * Validates the `version` field before the configuration * `forbidigo`: fix migration ### v2.0.0 _Released on 2025-03-24_ 1. Enhancements * 🌟 New `golangci-lint fmt` command with dedicated [formatter configuration](https://golangci-lint.run/docs/welcome/quick-start/#formatting) * ♻️ New `golangci-lint migrate` command to help migration from v1 to v2 (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#command-migrate)) * ⚠️ New default values (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/)) * ⚠️ No exclusions by default (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#issuesexclude-use-default)) * ⚠️ New default sort order (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#outputsort-order)) * 🌟 New option `run.relative-path-mode` (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#runrelative-path-mode)) * 🌟 New linters configuration (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#linters)) * 🌟 New output format configuration (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#output)) * 🌟 New `--fast-only` flag (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#lintersfast)) * 🌟 New option `linters.exclusions.warn-unused` to log a warning if an exclusion rule is unused. 2. New linters/formatters * Add `golines` formatter https://github.com/segmentio/golines 3. Linters new features * ⚠️ Merge `staticcheck`, `stylecheck`, `gosimple` into one linter (`staticcheck`) (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#lintersenablestylecheckgosimplestaticcheck)) * `gocritic`: from 0.12.0 to 0.13.0 * `gomodguard`: from 1.3.5 to 1.4.1 (block explicit indirect dependencies) * `nilnil`: from 1.0.1 to 1.1.0 (new option: `only-two`) * `perfsprint`: from 0.8.2 to 0.9.1 (checker name in the diagnostic message) * `staticcheck`: new `quickfix` set of rules * `testifylint`: from 1.5.2 to 1.6.0 (new options: `equal-values`, `suite-method-signature`, `require-string-msg`) * `wsl`: from 4.5.0 to 4.6.0 (new option: `allow-cuddle-used-in-block`) 4. Linters bug fixes * `bidichk`: from 0.3.2 to 0.3.3 * `errchkjson`: from 0.4.0 to 0.4.1 * `errname`: from 1.0.0 to 1.1.0 * `funlen`: fix `ignore-comments` option * `gci`: from 0.13.5 to 0.13.6 * `gosmopolitan`: from 1.2.2 to 1.3.0 * `inamedparam`: from 0.1.3 to 0.2.0 * `intrange`: from 0.3.0 to 0.3.1 * `protogetter`: from 0.3.9 to 0.3.12 * `unparam`: from 8a5130ca722f to 0df0534333a4 5. Misc. * 🧹 Configuration options renaming (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/)) * 🧹 Remove options (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/)) * 🧹 Remove flags (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/)) * 🧹 Remove alternative names (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/#alternative-linter-names)) * 🧹 Remove or replace deprecated elements (cf. [Migration guide](https://golangci-lint.run/docs/product/migration-guide/)) * Adds an option to display some commands as JSON: * `golangci-lint config path --json` * `golangci-lint help linters --json` * `golangci-lint help formatters --json` * `golangci-lint linters --json` * `golangci-lint formatters --json` * `golangci-lint version --json` 6. Documentation * [Migration guide](https://golangci-lint.run/docs/product/migration-guide/) ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: Makefile ================================================ .DEFAULT_GOAL = test .PHONY: FORCE # enable consistent Go 1.12/1.13 GOPROXY behavior. export GOPROXY = https://proxy.golang.org BINARY = golangci-lint ifeq ($(OS),Windows_NT) BINARY := $(BINARY).exe endif # Build build: $(BINARY) .PHONY: build build_race: go build -race -o $(BINARY) ./cmd/golangci-lint .PHONY: build_race clean: rm -f $(BINARY) rm -f test/path rm -f tools/Dracula.itermcolors rm -f tools/svg-term rm -rf tools/node_modules .PHONY: clean # Test test: export GOLANGCI_LINT_INSTALLED = true test: CGO_ENABLED=1 test: build GL_TEST_RUN=1 ./$(BINARY) run -v GL_TEST_RUN=1 go test -v -parallel 2 ./... .PHONY: test test_race: build_race GL_TEST_RUN=1 ./$(BINARY) run -v --timeout=5m .PHONY: test_race # ex: T=output.go make test_integration # the value of `T` is the name of a file from `test/testdata` test_integration: GL_TEST_RUN=1 go test -v ./test -count 1 -run TestSourcesFromTestdata/$T .PHONY: test_integration # ex: T=multiple-issues-fix.go make test_integration_fix # the value of `T` is the name of a file from `test/testdata/fix` test_integration_fix: build GL_TEST_RUN=1 go test -v ./test -count 1 -run TestFix/$T .PHONY: test_integration_fix # Maintenance fast_generate: assets/github-action-config.json .PHONY: fast_generate fast_check_generated: $(MAKE) --always-make fast_generate git checkout -- go.mod go.sum # can differ between go1.16 and go1.17 git diff --exit-code # check no changes # Migration clone_config: go run ./pkg/commands/internal/migrate/cloner/ # Benchmark # Benchmark with a local version # LINTER=gosec VERSION=v1.59.0 make bench_local bench_local: hyperfine @:$(call check_defined, LINTER VERSION, 'missing parameter(s)') @./scripts/bench/bench_local.sh $(LINTER) $(VERSION) .PHONY: bench_local # Benchmark between 2 existing versions # make bench_version LINTER=gosec VERSION_OLD=v1.58.2 VERSION_NEW=v1.59.0 bench_version: hyperfine @:$(call check_defined, LINTER VERSION_OLD VERSION_NEW, 'missing parameter(s)') @./scripts/bench/bench_version.sh $(LINTER) $(VERSION_OLD) $(VERSION_NEW) .PHONY: bench_version hyperfine: @which hyperfine > /dev/null || (echo "Please install hyperfine https://github.com/sharkdp/hyperfine#installation" && exit 1) .PHONY: hyperfine # Non-PHONY targets (real files) $(BINARY): FORCE go build -o $@ ./cmd/golangci-lint assets/github-action-config.json: FORCE $(BINARY) # go run ./scripts/gen_github_action_config/main.go $@ cd ./scripts/gen_github_action_config/; go run . ../../$@ go.mod: FORCE go mod tidy go mod verify go.sum: go.mod # Documentation docs_serve: website_expand_templates @make -C ./docs serve .PHONY: docs_serve docs_clean: @make -C ./docs clean .PHONY: docs_clean docs_build: website_copy_install_sh website_copy_jsonschema website_expand_templates @make -C ./docs build .PHONY: docs_build docs/static/demo.gif: FORCE vhs docs/golangci-lint.tape website_copy_jsonschema: go run ./scripts/website/copy_jsonschema/ .PHONY: website_copy_jsonschema website_copy_install_sh: cp install.sh ./docs/static/ .PHONY: website_copy_install_sh website_expand_templates: go run ./scripts/website/expand_templates/ .PHONY: website_expand_templates website_dump_info: go run ./scripts/website/dump_info/ .PHONY: website_dump_info # Functions # Check that given variables are set and all have non-empty values, # die with an error otherwise. # # Params: # 1. Variable name(s) to test. # 2. (optional) Error message to print. # # https://stackoverflow.com/a/10858332/8228109 check_defined = \ $(strip $(foreach 1,$1, \ $(call __check_defined,$1,$(strip $(value 2))))) __check_defined = \ $(if $(value $1),, \ $(error Undefined $1$(if $2, ($2)))) ================================================ FILE: README.md ================================================

golangci-lint logo

golangci-lint

Fast linters runner for Go

--- `golangci-lint` is a fast Go linters runner. It runs linters in parallel, uses caching, supports YAML configuration, integrates with all major IDEs, and includes over a hundred linters. ## Install `golangci-lint` - [On my machine](https://golangci-lint.run/docs/welcome/install/local); - [On CI/CD systems](https://golangci-lint.run/docs/welcome/install/ci). ## Documentation Documentation is hosted at https://golangci-lint.run. ## Social Networks [![Join Slack](https://img.shields.io/badge/Slack-4285F4?logo=slack&logoColor=white)](https://gophers.slack.com/archives/CS0TBRKPC) [![Follow on Mastodon](https://img.shields.io/badge/Mastodon-6364FF?logo=mastodon&logoColor=white)](https://fosstodon.org/@golangcilint) [![Follow on Bluesky](https://img.shields.io/badge/Bluesky-0a7aff?logo=bluesky&logoColor=white)](https://bsky.app/profile/golangci-lint.run) [![Follow on Twitter](https://img.shields.io/badge/Twitter-1DA1F2?logo=x&logoColor=white)](https://twitter.com/golangci) ## Support Us `golangci-lint` is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! :heart: [![Golangci-lint](https://img.shields.io/badge/Support-golangci_lint-blue?style=for-the-badge)](https://donate.golangci.org) [![Linter Authors](https://img.shields.io/badge/Support-Linter_Authors-blue?style=for-the-badge)](https://golangci-lint.run/docs/product/thanks/) ## Badges ![Build Status](https://github.com/golangci/golangci-lint/workflows/CI/badge.svg) [![License](https://img.shields.io/github/license/golangci/golangci-lint)](/LICENSE) [![Release](https://img.shields.io/github/release/golangci/golangci-lint.svg)](https://github.com/golangci/golangci-lint/releases/latest) [![Docker](https://img.shields.io/docker/pulls/golangci/golangci-lint)](https://hub.docker.com/r/golangci/golangci-lint) [![GitHub Releases Stats of golangci-lint](https://img.shields.io/github/downloads/golangci/golangci-lint/total.svg?logo=github)](https://somsubhra.github.io/github-release-stats/?username=golangci&repository=golangci-lint) ## Contributors This project exists thanks to all the people who contribute. [How to contribute](https://golangci-lint.run/docs/contributing/). ## Sponsors

 

The complete IDE crafted for professional Go developers.

## Stargazers over time [![Stargazers over time](https://starchart.cc/golangci/golangci-lint.svg?variant=adaptive)](https://starchart.cc/golangci/golangci-lint) ================================================ FILE: assets/github-action-config-v1.json ================================================ { "MinorVersionToConfig": { "latest": { "TargetVersion": "v1.64.8" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.28.3 and later versions" }, "v1.11": { "Error": "golangci-lint version 'v1.11' isn't supported: we support only v1.28.3 and later versions" }, "v1.12": { "Error": "golangci-lint version 'v1.12' isn't supported: we support only v1.28.3 and later versions" }, "v1.13": { "Error": "golangci-lint version 'v1.13' isn't supported: we support only v1.28.3 and later versions" }, "v1.14": { "Error": "golangci-lint version 'v1.14' isn't supported: we support only v1.28.3 and later versions" }, "v1.15": { "Error": "golangci-lint version 'v1.15' isn't supported: we support only v1.28.3 and later versions" }, "v1.16": { "Error": "golangci-lint version 'v1.16' isn't supported: we support only v1.28.3 and later versions" }, "v1.17": { "Error": "golangci-lint version 'v1.17' isn't supported: we support only v1.28.3 and later versions" }, "v1.18": { "Error": "golangci-lint version 'v1.18' isn't supported: we support only v1.28.3 and later versions" }, "v1.19": { "Error": "golangci-lint version 'v1.19' isn't supported: we support only v1.28.3 and later versions" }, "v1.20": { "Error": "golangci-lint version 'v1.20' isn't supported: we support only v1.28.3 and later versions" }, "v1.21": { "Error": "golangci-lint version 'v1.21' isn't supported: we support only v1.28.3 and later versions" }, "v1.22": { "Error": "golangci-lint version 'v1.22' isn't supported: we support only v1.28.3 and later versions" }, "v1.23": { "Error": "golangci-lint version 'v1.23' isn't supported: we support only v1.28.3 and later versions" }, "v1.24": { "Error": "golangci-lint version 'v1.24' isn't supported: we support only v1.28.3 and later versions" }, "v1.25": { "Error": "golangci-lint version 'v1.25' isn't supported: we support only v1.28.3 and later versions" }, "v1.26": { "Error": "golangci-lint version 'v1.26' isn't supported: we support only v1.28.3 and later versions" }, "v1.27": { "Error": "golangci-lint version 'v1.27' isn't supported: we support only v1.28.3 and later versions" }, "v1.28": { "TargetVersion": "v1.28.3" }, "v1.29": { "TargetVersion": "v1.29.0" }, "v1.3": { "Error": "golangci-lint version 'v1.3' isn't supported: we support only v1.28.3 and later versions" }, "v1.30": { "TargetVersion": "v1.30.0" }, "v1.31": { "TargetVersion": "v1.31.0" }, "v1.32": { "TargetVersion": "v1.32.2" }, "v1.33": { "TargetVersion": "v1.33.2" }, "v1.34": { "TargetVersion": "v1.34.1" }, "v1.35": { "TargetVersion": "v1.35.2" }, "v1.36": { "TargetVersion": "v1.36.0" }, "v1.37": { "TargetVersion": "v1.37.1" }, "v1.38": { "TargetVersion": "v1.38.0" }, "v1.39": { "TargetVersion": "v1.39.0" }, "v1.4": { "Error": "golangci-lint version 'v1.4' isn't supported: we support only v1.28.3 and later versions" }, "v1.40": { "TargetVersion": "v1.40.1" }, "v1.41": { "TargetVersion": "v1.41.1" }, "v1.42": { "TargetVersion": "v1.42.1" }, "v1.43": { "TargetVersion": "v1.43.0" }, "v1.44": { "TargetVersion": "v1.44.2" }, "v1.45": { "TargetVersion": "v1.45.2" }, "v1.46": { "TargetVersion": "v1.46.2" }, "v1.47": { "TargetVersion": "v1.47.3" }, "v1.48": { "TargetVersion": "v1.48.0" }, "v1.49": { "TargetVersion": "v1.49.0" }, "v1.5": { "Error": "golangci-lint version 'v1.5' isn't supported: we support only v1.28.3 and later versions" }, "v1.50": { "TargetVersion": "v1.50.1" }, "v1.51": { "TargetVersion": "v1.51.2" }, "v1.52": { "TargetVersion": "v1.52.2" }, "v1.53": { "TargetVersion": "v1.53.3" }, "v1.54": { "TargetVersion": "v1.54.2" }, "v1.55": { "TargetVersion": "v1.55.2" }, "v1.56": { "TargetVersion": "v1.56.2" }, "v1.57": { "TargetVersion": "v1.57.2" }, "v1.58": { "TargetVersion": "v1.58.2" }, "v1.59": { "TargetVersion": "v1.59.1" }, "v1.6": { "Error": "golangci-lint version 'v1.6' isn't supported: we support only v1.28.3 and later versions" }, "v1.60": { "TargetVersion": "v1.60.3" }, "v1.61": { "TargetVersion": "v1.61.0" }, "v1.62": { "TargetVersion": "v1.62.2" }, "v1.63": { "TargetVersion": "v1.63.4" }, "v1.64": { "TargetVersion": "v1.64.8" }, "v1.7": { "Error": "golangci-lint version 'v1.7' isn't supported: we support only v1.28.3 and later versions" }, "v1.8": { "Error": "golangci-lint version 'v1.8' isn't supported: we support only v1.28.3 and later versions" }, "v1.9": { "Error": "golangci-lint version 'v1.9' isn't supported: we support only v1.28.3 and later versions" }, "v2.0": { "Error": "golangci-lint version 'v2.0' isn't supported: only v1 versions are supported" }, "v2.1": { "Error": "golangci-lint version 'v2.1' isn't supported: only v1 versions are supported" }, "v2.10": { "Error": "golangci-lint version 'v2.10' isn't supported: only v1 versions are supported" }, "v2.11": { "Error": "golangci-lint version 'v2.11' isn't supported: only v1 versions are supported" }, "v2.2": { "Error": "golangci-lint version 'v2.2' isn't supported: only v1 versions are supported" }, "v2.3": { "Error": "golangci-lint version 'v2.3' isn't supported: only v1 versions are supported" }, "v2.4": { "Error": "golangci-lint version 'v2.4' isn't supported: only v1 versions are supported" }, "v2.5": { "Error": "golangci-lint version 'v2.5' isn't supported: only v1 versions are supported" }, "v2.6": { "Error": "golangci-lint version 'v2.6' isn't supported: only v1 versions are supported" }, "v2.7": { "Error": "golangci-lint version 'v2.7' isn't supported: only v1 versions are supported" }, "v2.8": { "Error": "golangci-lint version 'v2.8' isn't supported: only v1 versions are supported" }, "v2.9": { "Error": "golangci-lint version 'v2.9' isn't supported: only v1 versions are supported" } } } ================================================ FILE: assets/github-action-config-v2.json ================================================ { "MinorVersionToConfig": { "latest": { "TargetVersion": "v2.11.3" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v2.0.0 and later versions" }, "v1.11": { "Error": "golangci-lint version 'v1.11' isn't supported: we support only v2.0.0 and later versions" }, "v1.12": { "Error": "golangci-lint version 'v1.12' isn't supported: we support only v2.0.0 and later versions" }, "v1.13": { "Error": "golangci-lint version 'v1.13' isn't supported: we support only v2.0.0 and later versions" }, "v1.14": { "Error": "golangci-lint version 'v1.14' isn't supported: we support only v2.0.0 and later versions" }, "v1.15": { "Error": "golangci-lint version 'v1.15' isn't supported: we support only v2.0.0 and later versions" }, "v1.16": { "Error": "golangci-lint version 'v1.16' isn't supported: we support only v2.0.0 and later versions" }, "v1.17": { "Error": "golangci-lint version 'v1.17' isn't supported: we support only v2.0.0 and later versions" }, "v1.18": { "Error": "golangci-lint version 'v1.18' isn't supported: we support only v2.0.0 and later versions" }, "v1.19": { "Error": "golangci-lint version 'v1.19' isn't supported: we support only v2.0.0 and later versions" }, "v1.20": { "Error": "golangci-lint version 'v1.20' isn't supported: we support only v2.0.0 and later versions" }, "v1.21": { "Error": "golangci-lint version 'v1.21' isn't supported: we support only v2.0.0 and later versions" }, "v1.22": { "Error": "golangci-lint version 'v1.22' isn't supported: we support only v2.0.0 and later versions" }, "v1.23": { "Error": "golangci-lint version 'v1.23' isn't supported: we support only v2.0.0 and later versions" }, "v1.24": { "Error": "golangci-lint version 'v1.24' isn't supported: we support only v2.0.0 and later versions" }, "v1.25": { "Error": "golangci-lint version 'v1.25' isn't supported: we support only v2.0.0 and later versions" }, "v1.26": { "Error": "golangci-lint version 'v1.26' isn't supported: we support only v2.0.0 and later versions" }, "v1.27": { "Error": "golangci-lint version 'v1.27' isn't supported: we support only v2.0.0 and later versions" }, "v1.28": { "Error": "golangci-lint version 'v1.28' isn't supported: we support only v2.0.0 and later versions" }, "v1.29": { "Error": "golangci-lint version 'v1.29' isn't supported: we support only v2.0.0 and later versions" }, "v1.3": { "Error": "golangci-lint version 'v1.3' isn't supported: we support only v2.0.0 and later versions" }, "v1.30": { "Error": "golangci-lint version 'v1.30' isn't supported: we support only v2.0.0 and later versions" }, "v1.31": { "Error": "golangci-lint version 'v1.31' isn't supported: we support only v2.0.0 and later versions" }, "v1.32": { "Error": "golangci-lint version 'v1.32' isn't supported: we support only v2.0.0 and later versions" }, "v1.33": { "Error": "golangci-lint version 'v1.33' isn't supported: we support only v2.0.0 and later versions" }, "v1.34": { "Error": "golangci-lint version 'v1.34' isn't supported: we support only v2.0.0 and later versions" }, "v1.35": { "Error": "golangci-lint version 'v1.35' isn't supported: we support only v2.0.0 and later versions" }, "v1.36": { "Error": "golangci-lint version 'v1.36' isn't supported: we support only v2.0.0 and later versions" }, "v1.37": { "Error": "golangci-lint version 'v1.37' isn't supported: we support only v2.0.0 and later versions" }, "v1.38": { "Error": "golangci-lint version 'v1.38' isn't supported: we support only v2.0.0 and later versions" }, "v1.39": { "Error": "golangci-lint version 'v1.39' isn't supported: we support only v2.0.0 and later versions" }, "v1.4": { "Error": "golangci-lint version 'v1.4' isn't supported: we support only v2.0.0 and later versions" }, "v1.40": { "Error": "golangci-lint version 'v1.40' isn't supported: we support only v2.0.0 and later versions" }, "v1.41": { "Error": "golangci-lint version 'v1.41' isn't supported: we support only v2.0.0 and later versions" }, "v1.42": { "Error": "golangci-lint version 'v1.42' isn't supported: we support only v2.0.0 and later versions" }, "v1.43": { "Error": "golangci-lint version 'v1.43' isn't supported: we support only v2.0.0 and later versions" }, "v1.44": { "Error": "golangci-lint version 'v1.44' isn't supported: we support only v2.0.0 and later versions" }, "v1.45": { "Error": "golangci-lint version 'v1.45' isn't supported: we support only v2.0.0 and later versions" }, "v1.46": { "Error": "golangci-lint version 'v1.46' isn't supported: we support only v2.0.0 and later versions" }, "v1.47": { "Error": "golangci-lint version 'v1.47' isn't supported: we support only v2.0.0 and later versions" }, "v1.48": { "Error": "golangci-lint version 'v1.48' isn't supported: we support only v2.0.0 and later versions" }, "v1.49": { "Error": "golangci-lint version 'v1.49' isn't supported: we support only v2.0.0 and later versions" }, "v1.5": { "Error": "golangci-lint version 'v1.5' isn't supported: we support only v2.0.0 and later versions" }, "v1.50": { "Error": "golangci-lint version 'v1.50' isn't supported: we support only v2.0.0 and later versions" }, "v1.51": { "Error": "golangci-lint version 'v1.51' isn't supported: we support only v2.0.0 and later versions" }, "v1.52": { "Error": "golangci-lint version 'v1.52' isn't supported: we support only v2.0.0 and later versions" }, "v1.53": { "Error": "golangci-lint version 'v1.53' isn't supported: we support only v2.0.0 and later versions" }, "v1.54": { "Error": "golangci-lint version 'v1.54' isn't supported: we support only v2.0.0 and later versions" }, "v1.55": { "Error": "golangci-lint version 'v1.55' isn't supported: we support only v2.0.0 and later versions" }, "v1.56": { "Error": "golangci-lint version 'v1.56' isn't supported: we support only v2.0.0 and later versions" }, "v1.57": { "Error": "golangci-lint version 'v1.57' isn't supported: we support only v2.0.0 and later versions" }, "v1.58": { "Error": "golangci-lint version 'v1.58' isn't supported: we support only v2.0.0 and later versions" }, "v1.59": { "Error": "golangci-lint version 'v1.59' isn't supported: we support only v2.0.0 and later versions" }, "v1.6": { "Error": "golangci-lint version 'v1.6' isn't supported: we support only v2.0.0 and later versions" }, "v1.60": { "Error": "golangci-lint version 'v1.60' isn't supported: we support only v2.0.0 and later versions" }, "v1.61": { "Error": "golangci-lint version 'v1.61' isn't supported: we support only v2.0.0 and later versions" }, "v1.62": { "Error": "golangci-lint version 'v1.62' isn't supported: we support only v2.0.0 and later versions" }, "v1.63": { "Error": "golangci-lint version 'v1.63' isn't supported: we support only v2.0.0 and later versions" }, "v1.64": { "Error": "golangci-lint version 'v1.64' isn't supported: we support only v2.0.0 and later versions" }, "v1.7": { "Error": "golangci-lint version 'v1.7' isn't supported: we support only v2.0.0 and later versions" }, "v1.8": { "Error": "golangci-lint version 'v1.8' isn't supported: we support only v2.0.0 and later versions" }, "v1.9": { "Error": "golangci-lint version 'v1.9' isn't supported: we support only v2.0.0 and later versions" }, "v2.0": { "TargetVersion": "v2.0.2" }, "v2.1": { "TargetVersion": "v2.1.6" }, "v2.10": { "TargetVersion": "v2.10.1" }, "v2.11": { "TargetVersion": "v2.11.3" }, "v2.2": { "TargetVersion": "v2.2.2" }, "v2.3": { "TargetVersion": "v2.3.1" }, "v2.4": { "TargetVersion": "v2.4.0" }, "v2.5": { "TargetVersion": "v2.5.0" }, "v2.6": { "TargetVersion": "v2.6.2" }, "v2.7": { "TargetVersion": "v2.7.2" }, "v2.8": { "TargetVersion": "v2.8.0" }, "v2.9": { "TargetVersion": "v2.9.0" } } } ================================================ FILE: assets/github-action-config.json ================================================ { "MinorVersionToConfig": { "latest": { "TargetVersion": "v1.64.8" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.28.3 and later versions" }, "v1.11": { "Error": "golangci-lint version 'v1.11' isn't supported: we support only v1.28.3 and later versions" }, "v1.12": { "Error": "golangci-lint version 'v1.12' isn't supported: we support only v1.28.3 and later versions" }, "v1.13": { "Error": "golangci-lint version 'v1.13' isn't supported: we support only v1.28.3 and later versions" }, "v1.14": { "Error": "golangci-lint version 'v1.14' isn't supported: we support only v1.28.3 and later versions" }, "v1.15": { "Error": "golangci-lint version 'v1.15' isn't supported: we support only v1.28.3 and later versions" }, "v1.16": { "Error": "golangci-lint version 'v1.16' isn't supported: we support only v1.28.3 and later versions" }, "v1.17": { "Error": "golangci-lint version 'v1.17' isn't supported: we support only v1.28.3 and later versions" }, "v1.18": { "Error": "golangci-lint version 'v1.18' isn't supported: we support only v1.28.3 and later versions" }, "v1.19": { "Error": "golangci-lint version 'v1.19' isn't supported: we support only v1.28.3 and later versions" }, "v1.20": { "Error": "golangci-lint version 'v1.20' isn't supported: we support only v1.28.3 and later versions" }, "v1.21": { "Error": "golangci-lint version 'v1.21' isn't supported: we support only v1.28.3 and later versions" }, "v1.22": { "Error": "golangci-lint version 'v1.22' isn't supported: we support only v1.28.3 and later versions" }, "v1.23": { "Error": "golangci-lint version 'v1.23' isn't supported: we support only v1.28.3 and later versions" }, "v1.24": { "Error": "golangci-lint version 'v1.24' isn't supported: we support only v1.28.3 and later versions" }, "v1.25": { "Error": "golangci-lint version 'v1.25' isn't supported: we support only v1.28.3 and later versions" }, "v1.26": { "Error": "golangci-lint version 'v1.26' isn't supported: we support only v1.28.3 and later versions" }, "v1.27": { "Error": "golangci-lint version 'v1.27' isn't supported: we support only v1.28.3 and later versions" }, "v1.28": { "TargetVersion": "v1.28.3" }, "v1.29": { "TargetVersion": "v1.29.0" }, "v1.3": { "Error": "golangci-lint version 'v1.3' isn't supported: we support only v1.28.3 and later versions" }, "v1.30": { "TargetVersion": "v1.30.0" }, "v1.31": { "TargetVersion": "v1.31.0" }, "v1.32": { "TargetVersion": "v1.32.2" }, "v1.33": { "TargetVersion": "v1.33.2" }, "v1.34": { "TargetVersion": "v1.34.1" }, "v1.35": { "TargetVersion": "v1.35.2" }, "v1.36": { "TargetVersion": "v1.36.0" }, "v1.37": { "TargetVersion": "v1.37.1" }, "v1.38": { "TargetVersion": "v1.38.0" }, "v1.39": { "TargetVersion": "v1.39.0" }, "v1.4": { "Error": "golangci-lint version 'v1.4' isn't supported: we support only v1.28.3 and later versions" }, "v1.40": { "TargetVersion": "v1.40.1" }, "v1.41": { "TargetVersion": "v1.41.1" }, "v1.42": { "TargetVersion": "v1.42.1" }, "v1.43": { "TargetVersion": "v1.43.0" }, "v1.44": { "TargetVersion": "v1.44.2" }, "v1.45": { "TargetVersion": "v1.45.2" }, "v1.46": { "TargetVersion": "v1.46.2" }, "v1.47": { "TargetVersion": "v1.47.3" }, "v1.48": { "TargetVersion": "v1.48.0" }, "v1.49": { "TargetVersion": "v1.49.0" }, "v1.5": { "Error": "golangci-lint version 'v1.5' isn't supported: we support only v1.28.3 and later versions" }, "v1.50": { "TargetVersion": "v1.50.1" }, "v1.51": { "TargetVersion": "v1.51.2" }, "v1.52": { "TargetVersion": "v1.52.2" }, "v1.53": { "TargetVersion": "v1.53.3" }, "v1.54": { "TargetVersion": "v1.54.2" }, "v1.55": { "TargetVersion": "v1.55.2" }, "v1.56": { "TargetVersion": "v1.56.2" }, "v1.57": { "TargetVersion": "v1.57.2" }, "v1.58": { "TargetVersion": "v1.58.2" }, "v1.59": { "TargetVersion": "v1.59.1" }, "v1.6": { "Error": "golangci-lint version 'v1.6' isn't supported: we support only v1.28.3 and later versions" }, "v1.60": { "TargetVersion": "v1.60.3" }, "v1.61": { "TargetVersion": "v1.61.0" }, "v1.62": { "TargetVersion": "v1.62.2" }, "v1.63": { "TargetVersion": "v1.63.4" }, "v1.64": { "TargetVersion": "v1.64.8" }, "v1.7": { "Error": "golangci-lint version 'v1.7' isn't supported: we support only v1.28.3 and later versions" }, "v1.8": { "Error": "golangci-lint version 'v1.8' isn't supported: we support only v1.28.3 and later versions" }, "v1.9": { "Error": "golangci-lint version 'v1.9' isn't supported: we support only v1.28.3 and later versions" }, "v2.0": { "Error": "golangci-lint version 'v2.0' isn't supported: only v1 versions are supported" }, "v2.1": { "Error": "golangci-lint version 'v2.1' isn't supported: only v1 versions are supported" }, "v2.10": { "Error": "golangci-lint version 'v2.10' isn't supported: only v1 versions are supported" }, "v2.11": { "Error": "golangci-lint version 'v2.11' isn't supported: only v1 versions are supported" }, "v2.2": { "Error": "golangci-lint version 'v2.2' isn't supported: only v1 versions are supported" }, "v2.3": { "Error": "golangci-lint version 'v2.3' isn't supported: only v1 versions are supported" }, "v2.4": { "Error": "golangci-lint version 'v2.4' isn't supported: only v1 versions are supported" }, "v2.5": { "Error": "golangci-lint version 'v2.5' isn't supported: only v1 versions are supported" }, "v2.6": { "Error": "golangci-lint version 'v2.6' isn't supported: only v1 versions are supported" }, "v2.7": { "Error": "golangci-lint version 'v2.7' isn't supported: only v1 versions are supported" }, "v2.8": { "Error": "golangci-lint version 'v2.8' isn't supported: only v1 versions are supported" }, "v2.9": { "Error": "golangci-lint version 'v2.9' isn't supported: only v1 versions are supported" } } } ================================================ FILE: build/buildx-alpine.Dockerfile ================================================ # syntax=docker/dockerfile:1.4 FROM golang:1.26-alpine ARG TARGETPLATFORM # related to https://github.com/golangci/golangci-lint/issues/3107 ENV GOROOT /usr/local/go # Allow to download a more recent version of Go. # https://go.dev/doc/toolchain # GOTOOLCHAIN=auto is shorthand for GOTOOLCHAIN=local+auto ENV GOTOOLCHAIN auto # gcc is required to support cgo; # git and mercurial are needed most times for go get`, etc. # See https://github.com/docker-library/golang/issues/80 RUN apk --no-cache add gcc musl-dev git mercurial # Set all directories as safe RUN git config --global --add safe.directory '*' COPY $TARGETPLATFORM/golangci-lint /usr/bin/ CMD ["golangci-lint"] ================================================ FILE: build/buildx.Dockerfile ================================================ # syntax=docker/dockerfile:1.4 FROM golang:1.26 ARG TARGETPLATFORM # related to https://github.com/golangci/golangci-lint/issues/3107 ENV GOROOT /usr/local/go # Allow to download a more recent version of Go. # https://go.dev/doc/toolchain # GOTOOLCHAIN=auto is shorthand for GOTOOLCHAIN=local+auto ENV GOTOOLCHAIN auto # Set all directories as safe RUN git config --global --add safe.directory '*' COPY $TARGETPLATFORM/golangci-lint /usr/bin/ CMD ["golangci-lint"] ================================================ FILE: cmd/golangci-lint/main.go ================================================ package main import ( "cmp" "fmt" "os" "regexp" "runtime/debug" "strings" "github.com/golangci/golangci-lint/v2/pkg/commands" "github.com/golangci/golangci-lint/v2/pkg/exitcodes" ) var ( goVersion = "unknown" // Populated by goreleaser during build version = "unknown" commit = "?" date = "" ) func main() { info := createBuildInfo() if err := commands.Execute(info); err != nil { _, _ = fmt.Fprintf(os.Stderr, "The command is terminated due to an error: %v\n", err) os.Exit(exitcodes.Failure) } } func createBuildInfo() commands.BuildInfo { info := commands.BuildInfo{ Commit: commit, Version: version, GoVersion: goVersion, Date: date, } buildInfo, available := debug.ReadBuildInfo() if !available { return info } info.GoVersion = buildInfo.GoVersion if date != "" { return info } info.Version = buildInfo.Main.Version matched, _ := regexp.MatchString(`v\d+\.\d+\.\d+`, buildInfo.Main.Version) if matched { info.Version = strings.TrimPrefix(buildInfo.Main.Version, "v") } var revision string var modified string for _, setting := range buildInfo.Settings { // The `vcs.xxx` information is only available with `go build`. // This information is not available with `go install` or `go run`. switch setting.Key { case "vcs.time": info.Date = setting.Value case "vcs.revision": revision = setting.Value case "vcs.modified": modified = setting.Value } } info.Date = cmp.Or(info.Date, "(unknown)") info.Commit = fmt.Sprintf("(%s, modified: %s, mod sum: %q)", cmp.Or(revision, "unknown"), cmp.Or(modified, "?"), buildInfo.Main.Sum) return info } ================================================ FILE: cmd/golangci-lint/plugins.go ================================================ package main // This file is used to declare module plugins. ================================================ FILE: docs/.gitignore ================================================ ### Hugo files .hugo_build.lock public/ resources/ # Copy of install.sh /static/install.sh ### Generated files # Generated by /scripts/copy_jsonschema /static/jsonschema/ # Generated by /scripts/expand_templates data/version.json data/formatter_settings.json data/linter_settings.json .tmp/ ================================================ FILE: docs/Makefile ================================================ .PHONY: default clean serve build default: clean serve clean: rm -rf public/ serve: clean hugo server --disableFastRender --buildDrafts --enableGitInfo # IMPORTANT used by the CI to deploy documentation build: clean HUGO_ENVIRONMENT=production \ HUGO_ENV=production \ hugo \ --gc --minify \ --baseURL "https://golangci-lint.run/" ================================================ FILE: docs/archetypes/default.md ================================================ --- date: '{{ .Date }}' draft: true title: '{{ replace .File.ContentBaseName "-" " " | title }}' --- ================================================ FILE: docs/assets/css/custom.css ================================================ :root { --primary-hue: 187deg; --primary-saturation: 54.4%; --primary-lightness: 57.8%; } /* Allow card subtitle with more than 3 lines */ .hx\:line-clamp-3.hextra-card-subtitle { -webkit-line-clamp: 30; } .author-cards { grid-template-columns: repeat(auto-fill, minmax(max(150px, calc((100% - 1rem * 4) / var(--hextra-cards-grid-cols))), 1fr)); } .support-cards { grid-template-columns: repeat(auto-fill, minmax(max(200px, calc((100% - 1rem * 4) / var(--hextra-cards-grid-cols))), 1fr)); } .support-cards .hextra-card-image { margin: 2rem; } .gl-hidden { display: none; } .hextra-nav-container a[title="Support us"] { transition: ease-in-out 0.2s; } .hextra-nav-container a[title="Support us"]:hover { transform: scale(1.3, 1.3); } .hextra-footer .social-media { transition: ease-in-out 0.2s; } .hextra-footer .social-media :hover{ transform: translateY(-2px); } .hextra-banner { background: #833AB4; background: linear-gradient(90deg,rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%); /*color: var(--hx-color-slate-900);*/ } .extra-banner-close-button { color: var(--hx-color-slate-50); } ================================================ FILE: docs/content/_index.md ================================================ --- title: 'Golangci-lint' layout: hextra-home params: width: wide --- {{< hextra/hero-container image="images/golangci-lint-logo-anim.gif" imageWidth="300" imageHeight="300" imageTitle="golangci-lint" >}}
{{< hextra/hero-headline >}} Golangci-lint is a fast linters runner for Go {{< /hextra/hero-headline >}}
{{< hextra/hero-subtitle >}} It runs linters in parallel, uses caching, supports YAML configuration, 
integrates with all major IDEs, and includes over a hundred linters. {{< /hextra/hero-subtitle >}}
{{< hextra/hero-button text="Get Started" link="docs" >}}
{{< /hextra/hero-container >}}
{{< hextra/feature-grid cols=3 >}} {{< hextra/feature-card icon="fast-forward" title="Fast" subtitle="Runs linters in parallel, reuses Go build cache and caches analysis results." style="background: radial-gradient(ellipse at 50% 80%,rgba(194,97,254,0.15),hsla(0,0%,100%,0));" link="/docs/" >}} {{< hextra/feature-card icon="desktop-computer" title="Integrations" subtitle="Integrations with VS Code, Sublime Text, GoLand, GNU Emacs, Vim, GitHub Actions." style="background: radial-gradient(ellipse at 50% 80%,rgba(142,53,74,0.15),hsla(0,0%,100%,0));" link="/docs/welcome/integrations" >}} {{< hextra/feature-card icon="sparkles" title="Nice outputs" subtitle="Text with colors and source code lines, JSON, tab, HTML, Checkstyle, Code-Climate, JUnit-XML, TeamCity, SARIF." style="background: radial-gradient(ellipse at 50% 80%,rgba(221,210,59,0.15),hsla(0,0%,100%,0));" link="/docs/configuration/file/#output-configuration" >}} {{< hextra/feature-card icon="eye-off" title="Minimum number of false positives" subtitle="Tuned default settings." link="/docs/linters/false-positives" >}} {{< hextra/feature-card icon="collection" title="A lot of linters" subtitle="No need to install them." link="/docs/linters" >}} {{< hextra/feature-card icon="document-text" title="YAML-based configuration" subtitle="Easy to read and maintain." link="/docs/configuration/file" >}} {{< /hextra/feature-grid >}} ================================================ FILE: docs/content/docs/_index.md ================================================ --- title: 'Golangci-lint Documentation' --- {{< hextra/hero-subtitle >}} Everything you need to know for your golangci-lint journey. {{< /hextra/hero-subtitle >}} ![golangci-lint demo](/images/demo.gif) {{< cards >}} {{< card link="/docs/welcome/quick-start" title="Getting Started" subtitle="Get ready to use golangci-lint" icon="arrow-circle-right" >}} {{< card link="/docs/linters" title="Linters" subtitle="List of all the linters" icon="arrow-circle-right" >}} {{< card link="/docs/formatters" title="Formatters" subtitle="List of all the formatters" icon="arrow-circle-right" >}} {{< /cards >}} ## Support Us Golangci-lint is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! {{< golangci/button text="Donate ❤️" link="/docs/donate" >}} ## Contributors This project exists thanks to all the people who contribute. [How to contribute](/docs/contributing/workflow/). [![golangci-lint contributors](https://opencollective.com/golangci-lint/contributors.svg?width=890&button=false&skip=golangcidev,CLAassistant,renovate,fossabot,golangcibot,kortschak,golangci-releaser,dependabot%5Bbot%5D)](https://github.com/golangci/golangci-lint/graphs/contributors) ## Stargazers over time {{< golangci/starcharts repo="golangci/golangci-lint" >}} ================================================ FILE: docs/content/docs/configuration/_index.md ================================================ --- title: Configuration weight: 2 aliases: - /usage/configuration/ --- The config file has lower priority than command-line options. If the same bool/string/int option is provided on the command-line and in the config file, the option from command-line will be used. Slice options (e.g. list of enabled/disabled linters) are combined from the command-line and config file. ## More {{< cards cols=2 >}} {{< card link="/docs/configuration/cli" title="Command Line" icon="terminal" >}} {{< card link="/docs/configuration/file" title="Configuration File" icon="adjustments" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/configuration/cli.md ================================================ --- title: Command-Line weight: 1 --- {{% golangci/cli-output %}} ## `run` {{< cards >}} {{< card link="/docs/linters" title="Linters Overview" icon="collection" >}} {{< card link="/docs/configuration/file/#linters-configuration" title="Global Configuration" icon="adjustments" >}} {{< card link="/docs/linters/configuration/" title="Linter Settings" icon="adjustments" >}} {{< /cards >}} > [!NOTE] > This command executes enabled linters, and the formatters defined in [`formatters`](/docs/configuration/file/#formatters-configuration), > but it does not format the code. > > To only format code, use [`golangci-lint fmt`](/docs/configuration/cli/#fmt). > To apply both linter fixes and formatting, use `golangci-lint run --fix`. > > The formatters cannot be enabled or disabled inside the [`linters`](/docs/configuration/file/#linters-configuration) section or the flags `-E/--enable`, `-D/--disable` of the command [`golangci-lint run`](/docs/configuration/cli/#run). > > The formatters can be enabled/disabled by defining them inside the [`formatters`](/docs/configuration/file/#formatters-configuration) section or by using the flags `-E/--enable`, `-D/--disable` of command [`golangci-lint fmt`](/docs/configuration/cli/#fmt). {{% golangci/cli-output cmd="run" %}} When the `--cpu-profile-path` or `--mem-profile-path` arguments are specified, golangci-lint writes runtime profiling data in the format expected by the [pprof](https://github.com/google/pprof) visualization tool. When the `--trace-path` argument is specified, `golangci-lint` writes runtime tracing data in the format expected by the `go tool trace` command and visualization tool. ## fmt {{< cards >}} {{< card link="/docs/formatters" title="Formatters Overview" icon="collection" >}} {{< card link="/docs/configuration/file/#formatters-configuration" title="Global Configuration" icon="adjustments" >}} {{< card link="/docs/formatters/configuration/" title="Formatter Settings" icon="adjustments" >}} {{< /cards >}} {{% golangci/cli-output cmd="fmt" %}} ## `migrate` {{% golangci/cli-output cmd="migrate" %}} ## `formatters` {{% golangci/cli-output cmd="formatters" %}} ## `help` {{% golangci/cli-output cmd="help" %}} ## `linters` {{% golangci/cli-output cmd="linters" %}} ## `cache` Golangci-lint stores its cache in the subdirectory `golangci-lint` inside the [default user cache directory](https://pkg.go.dev/os#UserCacheDir). You can override the default cache directory with the environment variable `GOLANGCI_LINT_CACHE`; the path must be absolute. The cache is only used by `golangci-lint run` (linters). {{% golangci/cli-output cmd="cache" %}} ## `config` {{% golangci/cli-output cmd="config" %}} ## `custom` {{% golangci/cli-output cmd="custom" %}} ## `version` {{% golangci/cli-output cmd="version" %}} ## `completion` {{% golangci/cli-output cmd="completion" %}} ================================================ FILE: docs/content/docs/configuration/file.md ================================================ --- title: Configuration File weight: 2 --- Golangci-lint looks for config files in the following paths from the current working directory: - `.golangci.yml` - `.golangci.yaml` - `.golangci.toml` - `.golangci.json` Golangci-lint also searches for config files in all directories from the directory of the first analyzed path up to the root. If no configuration file has been found, golangci-lint will try to find one in your home directory. To see which config file is being used and where it was sourced from run golangci-lint with `-v` option. Config options inside the file are identical to command-line options. You can configure specific linters' options only within the config file (not the command-line). There is a [`.golangci.reference.yml`](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.reference.yml) file with all supported options, their descriptions, and default values. This file is neither a working example nor a recommended configuration, it's just a reference to display all the configuration options used to generate the documentation. The configuration file can be validated with the JSON Schema: [golangci.jsonschema.json](https://golangci-lint.run/jsonschema/golangci.jsonschema.json) {{% golangci/configuration-file-snippet section="root" %}} ## `version` configuration {{% golangci/configuration-file-snippet section="version" %}} ## `linters` configuration {{< cards cols=2 >}} {{< card link="/docs/linters" title="Linters Overview" icon="collection" >}} {{< card link="/docs/linters/configuration" title="Linters Settings" icon="adjustments" >}} {{< /cards >}} {{% golangci/configuration-file-snippet section="linters" %}} ## `formatters` configuration {{< cards cols=2 >}} {{< card link="/docs/formatters" title="Formatters Overview" icon="collection" >}} {{< card link="/docs/formatters/configuration" title="Formatters Settings" icon="adjustments" >}} {{< /cards >}} {{% golangci/configuration-file-snippet section="formatters" %}} ## `issues` configuration {{% golangci/configuration-file-snippet section="issues" %}} ## `output` configuration {{% golangci/configuration-file-snippet section="output" %}} ## `run` configuration {{% golangci/configuration-file-snippet section="run" %}} ## `severity` configuration {{% golangci/configuration-file-snippet section="severity" %}} ================================================ FILE: docs/content/docs/contributing/_index.md ================================================ --- title: Contributing weight: 6 aliases: - /contributing/quick-start/ --- {{< cards >}} {{< card link="/docs/contributing/workflow/" title="Contributing workflow" icon="document-text" >}} {{< card link="/docs/contributing/architecture/" title="Architecture of golangci-lint" icon="code" >}} {{< card link="/docs/contributing/new-linters/" title="How to add new linters" icon="document-text" >}} {{< card link="/docs/contributing/debug/" title="Debugging golangci-lint" icon="code" >}} {{< card link="/docs/contributing/faq/" title="FAQ" icon="question-mark-circle" >}} {{< card link="/docs/contributing/website/" title="Contributing to this website" icon="globe" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/contributing/architecture.md ================================================ --- title: Architecture weight: 3 aliases: - /contributing/architecture/ --- There are the following golangci-lint execution steps: ```mermaid graph LR init[Init] loadPackages[Load packages] runLinters[Run linters] postprocess[Postprocess issues] print[Print issues] init --> loadPackages --> runLinters --> postprocess --> print ``` ## Init The configuration is loaded from file and flags by `config.Loader` inside `PersistentPreRun` (or `PreRun`) of the commands that require configuration. The linter database (`linterdb.Manager`) is fill based on the configuration: - The linters ("internals" and plugins) are built by `linterdb.LinterBuilder` and `linterdb.PluginBuilder` builders. - The configuration is validated by `linterdb.Validator`. ## Load Packages Loading packages is listing all packages and their recursive dependencies for analysis. Also, depending on the enabled linters set some parsing of the source code can be performed at this step. Packages loading starts here: ```go {base_url="https://github.com/golangci/golangci-lint/blob/HEAD/", filename="pkg/lint/package.go"} func (l *PackageLoader) Load(ctx context.Context, linters []*linter.Config) (pkgs, deduplicatedPkgs []*packages.Package, err error) { loadMode := findLoadMode(linters) pkgs, err = l.loadPackages(ctx, loadMode) if err != nil { return nil, nil, fmt.Errorf("failed to load packages: %w", err) } // ... ``` First, we find a load mode as union of load modes for all enabled linters. We use [go/packages](https://pkg.go.dev/golang.org/x/tools/go/packages) for packages loading and use its enum `packages.Need*` for load modes. Load mode sets which data a linter needs for execution. A linter that works only with AST need minimum of information: only filenames and AST. There is no need for packages dependencies or type information. AST is built during `go/analysis` execution to reduce memory usage. Such AST-based linters are configured with the following code: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/lint/linter/config.go"} func (lc *Config) WithLoadFiles() *Config { lc.LoadMode |= packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles return lc } ``` If a linter uses `go/analysis` and needs type information, we need to extract more data by `go/packages`: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/lint/linter/config.go"} func (lc *Config) WithLoadForGoAnalysis() *Config { lc = lc.WithLoadFiles() lc.LoadMode |= packages.NeedImports | packages.NeedDeps | packages.NeedExportFile | packages.NeedTypesSizes lc.IsSlow = true return lc } ``` After finding a load mode, we run `go/packages`: the library get list of dirs (or `./...` as the default value) as input and outputs list of packages and requested information about them: filenames, type information, AST, etc. ## Run Linters First, we need to find all enabled linters. All linters are registered here: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/lint/lintersdb/builder_linter.go"} func (b LinterBuilder) Build(cfg *config.Config) []*linter.Config { // ... return []*linter.Config{ // ... linter.NewConfig(golinters.NewBodyclose()). WithSince("v1.18.0"). WithLoadForGoAnalysis(). WithURL("https://github.com/timakin/bodyclose"), // ... linter.NewConfig(golinters.NewGovet(govetCfg)). WithGroups(config.GroupStandard). WithSince("v1.0.0"). WithLoadForGoAnalysis(). WithURL("https://pkg.go.dev/cmd/vet"), // ... } } ``` We filter requested in config and command-line linters in `EnabledSet`: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/lint/lintersdb/manager.go"} func (m *Manager) GetEnabledLintersMap() (map[string]*linter.Config, error) ``` We merge enabled linters into one `MetaLinter` to improve execution time if we can: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/lint/lintersdb/manager.go"} // GetOptimizedLinters returns enabled linters after optimization (merging) of multiple linters into a fewer number of linters. // E.g. some go/analysis linters can be optimized into one metalinter for data reuse and speed up. func (m *Manager) GetOptimizedLinters() ([]*linter.Config, error) { // ... m.combineGoAnalysisLinters(resultLintersSet) // ... } ``` The `MetaLinter` just stores all merged linters inside to run them at once: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/goanalysis/metalinter.go"} type MetaLinter struct { linters []*Linter analyzerToLinterName map[*analysis.Analyzer]string } ``` Currently, all linters except `unused` can be merged into this meta linter. The `unused` isn't merged because it has high memory usage. Linters execution starts in `runAnalyzers`. It's the most complex part of the golangci-lint. We use custom [go/analysis](https://pkg.go.dev/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can to reduce memory usage. Also, it sets all heavyweight data to `nil` as becomes unneeded to save memory. We don't use existing [multichecker](https://pkg.go.dev/golang.org/x/tools/go/analysis/multichecker) because it doesn't use caching and doesn't have some important performance optimizations. All found by linters issues are represented with `result.Issue` struct: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/result/issue.go"} type Issue struct { FromLinter string Text string Severity string // Source lines of a code with the issue to show SourceLines []string // Pkg is needed for proper caching of linting results Pkg *packages.Package `json:"-"` Pos token.Position LineRange *Range `json:",omitempty"` // HunkPos is used only when golangci-lint is run over a diff HunkPos int `json:",omitempty"` // If we know how to fix the issue we can provide replacement lines SuggestedFixes []analysis.SuggestedFix `json:",omitempty"` // If we are expecting a nolint (because this is from nolintlint), record the expected linter ExpectNoLint bool ExpectedNoLintLinter string // ... } ``` ## Postprocess Issues We have an abstraction of `result.Processor` to postprocess found issues: {{< filetree/container >}} {{< filetree/folder name="./pkg/result/processors/" >}} {{< filetree/file name="cgo.go" >}} {{< filetree/file name="diff.go" >}} {{< filetree/file name="exclusion_generated_file_filter.go" >}} {{< filetree/file name="exclusion_generated_file_matcher.go" >}} {{< filetree/file name="exclusion_paths.go" >}} {{< filetree/file name="exclusion_presets.go" >}} {{< filetree/file name="exclusion_rules.go" >}} {{< filetree/file name="filename_unadjuster.go" >}} {{< filetree/file name="fixer.go" >}} {{< filetree/file name="identifier_marker.go" >}} {{< filetree/file name="invalid_issue.go" >}} {{< filetree/file name="issues.go" >}} {{< filetree/file name="max_from_linter.go" >}} {{< filetree/file name="max_per_file_from_linter.go" >}} {{< filetree/file name="max_same_issues.go" >}} {{< filetree/file name="nolint_filter.go" >}} {{< filetree/file name="path_absoluter.go" >}} {{< filetree/file name="path_prettifier.go" >}} {{< filetree/file name="path_relativity.go" >}} {{< filetree/file name="path_shortener.go" >}} {{< filetree/file name="processor.go" >}} {{< filetree/file name="severity.go" >}} {{< filetree/file name="sort_results.go" >}} {{< filetree/file name="source_code.go" >}} {{< filetree/file name="uniq_by_line.go" >}} {{< /filetree/folder >}} {{< /filetree/container >}} The abstraction is simple: ```go {base_url="https://github.com/golangci/golangci-lint/blob/main/", filename="pkg/result/processors/processor.go"} type Processor interface { Process(issues []*result.Issue) ([]*result.Issue, error) Name() string Finish() } ``` A processor can hide issues (`nolint`, `exclude`) or change issues (`path_prettifier`). ## Print Issues We have an abstraction for printing found issues. {{< filetree/container >}} {{< filetree/folder name="./pkg/printers/" >}} {{< filetree/file name="checkstyle.go" >}} {{< filetree/file name="codeclimate.go" >}} {{< filetree/file name="html.go" >}} {{< filetree/file name="json.go" >}} {{< filetree/file name="junitxml.go" >}} {{< filetree/file name="printer.go" >}} {{< filetree/file name="sarif.go" >}} {{< filetree/file name="tab.go" >}} {{< filetree/file name="teamcity.go" >}} {{< filetree/file name="text.go" >}} {{< /filetree/folder >}} {{< /filetree/container >}} ================================================ FILE: docs/content/docs/contributing/debug.md ================================================ --- title: Debugging weight: 5 aliases: - /contributing/debug/ --- You can see a verbose output of linter by using `-v` option. ```bash golangci-lint run -v ``` If you would like to see more detailed logs you can use the environment variable `GL_DEBUG`. Its value is a list of debug tags. The existing debug tags are documented in the following file: [/pkg/logutils/logutils.go](https://github.com/golangci/golangci-lint/blob/HEAD/pkg/logutils/logutils.go) For example: ```bash GL_DEBUG="loader,gocritic" golangci-lint run ``` ```bash GL_DEBUG="loader,env" golangci-lint run ``` ================================================ FILE: docs/content/docs/contributing/faq.md ================================================ --- title: FAQ weight: 6 aliases: - /contributing/faq/ --- ## How to add a new open-source linter to `golangci-lint` See [there](/docs/contributing/new-linters#how-to-add-a-public-linter-to-golangci-lint). ## How to add a new private linter to `golangci-lint` See [there](/docs/contributing/new-linters#how-to-add-a-private-linter-to-golangci-lint). ## How to update an existing linter We use [Dependabot](https://github.com/golangci/golangci-lint/blob/HEAD/.github/dependabot.yml) to update dependencies, including linters. The updates happen automatically at least once a week (Sunday 11am UTC). No pull requests to update a linter will be accepted unless you are the author of the linter and specific changes are required. ## How to add a configuration option to an existing linter Add a new field to the [linter settings struct](https://github.com/golangci/golangci-lint/blob/HEAD/pkg/config/linters_settings.go). Document it in [.golangci.next.reference.yml](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.next.reference.yml). Pass it to the linter. ## How to see `INFO` or `DEBUG` logs See [tutorial about debugging](/docs/contributing/debug/). ================================================ FILE: docs/content/docs/contributing/new-linters.md ================================================ --- title: New linters weight: 4 aliases: - /contributing/new-linters/ --- ## How to write a linter Use `go/analysis` and take a look at [this tutorial](https://web.archive.org/web/20250527152107/https://disaev.me/p/writing-useful-go-analysis-linter/): it shows how to write `go/analysis` linter from scratch and integrate it into `golangci-lint`. ## How to add a public linter to `golangci-lint` You need to implement a new linter using `go/analysis` API. We don't accept non `go/analysis` linters. After that: 1. Implement functional tests for the linter: - Add one file into directory `pkg/golinters/{yourlintername}/testdata/`. 2. Add a new file `pkg/golinters/{yourlintername}/{yourlintername}.go`. Other linters implementation can help you. 3. Add the new struct for the linter (which you've implemented in `pkg/golinters/{yourlintername}/{yourlintername}.go`) to the list of all supported linters in [`pkg/lint/lintersdb/builder_linter.go`](https://github.com/golangci/golangci-lint/blob/HEAD/pkg/lint/lintersdb/builder_linter.go) to the method `LinterBuilder.Build`. - Add `WithSince("next_version")`, where `next_version` must be replaced by the next minor version. (ex: v1.2.0 if the current version is v1.1.0) 4. Find out what options do you need to configure for the linter. For example, `nakedret` has only 1 option: [`max-func-lines`](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.reference.yml). Choose default values to not be annoying for users of golangci-lint. Add configuration options to: - [.golangci.next.reference.yml](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.next.reference.yml): the example of a configuration file. You can also add them to [.golangci.yml](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.yml) if you think that this project needs not default values. - [config struct](https://github.com/golangci/golangci-lint/blob/HEAD/pkg/config/config.go): don't forget about `mapstructure` tags for proper configuration files parsing. 5. Take a look at the example of [pull requests with new linter support](https://github.com/golangci/golangci-lint/pulls?q=is%3Apr+is%3Amerged+label%3A%22linter%3A+new%22). 6. Run the tests: ```bash go run ./cmd/golangci-lint/ run --no-config --default=none --enable={yourlintername} ./pkg/golinters/{yourlintername}/testdata/{yourlintername}.go ``` ## How to add a private linter to `golangci-lint` Some people and organizations may choose to have custom-made linters run as a part of `golangci-lint`. Typically, these linters can't be open-sourced or too specific. Such linters can be added through 2 plugin systems: {{< cards cols=2 >}} {{< card link="/docs/plugins/module-plugins" title="Module Plugin System" icon="puzzle" tag="Recommended" >}} {{< card link="/docs/plugins/go-plugins" title="Go Plugin System" icon="puzzle" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/contributing/website.md ================================================ --- title: This Website weight: 7 aliases: - /contributing/website/ --- ## Technology We use [Hugo](https://gohugo.io/) for static site generation because sites built with it are very fast. ## Source Code The website lives in `docs/` directory of [golangci-lint repository](https://github.com/golangci/golangci-lint). ## Theme The site is based on [hextra](https://github.com/imfing/hextra) theme. ## Templating We use [shortcodes](https://gohugo.io/templates/types/#shortcode) and [partials](https://gohugo.io/templates/types/#partial) based on files from `./docs/.tmp/` and `./docs/data/`. - The files in `./docs/.tmp/` are used to be embedded with the shortcode `{{%/* golangci/embed file="filename.ext" */%}}`. - The files in `./docs/data/` are used as [data sources](https://gohugo.io/content-management/data-sources/). These files are created by running: - `make website_expand_templates` in the root of the repository. - `make website_dump_info` in the root of the repository. (only during a release) ### Some Notes [shortcodes](https://gohugo.io/templates/types/#shortcode): - cannot be used inside another shortcode - can only be used inside a page - can contain Markdown or HTML, but the tag is different: `{{%/* shortcode */%}}` vs `{{}}` [partials](https://gohugo.io/templates/types/#partial): - are reusable HTML blocks or "functions" - cannot be used inside a page - can be used inside another partial - can be used inside a shortcode - can be used inside a layout ## Hosting We use GitHub Pages for static website hosting and CD. GitHub deploys the website to production after merging anything to a `main` branch. ## Local Testing Install Hugo Extended (v0.148.1 or newer). Run: ```bash # (in the root of the repository) make docs_serve ``` or ```bash # (in the root of the repository) make website_expand_templates cd docs/ # (inside the docs/ folder) make serve ``` And navigate to `http://localhost:1313` after a successful build. There is no need to restart the Hugo server for almost all changes: it supports hot reload. Also, there is no need to refresh a webpage: hot reload updates changed content on the open page. ## Website Build To do this, run: ```bash # (in the root of the repository) make docs_build ``` or ```bash # (in the root of the repository) make website_copy_jsonschema website_expand_templates cd docs/ # (inside the docs/ folder) make build ``` ================================================ FILE: docs/content/docs/contributing/workflow.md ================================================ --- title: Workflow weight: 2 aliases: - /contributing/workflow/ --- By participating in this project, you agree to abide our [code of conduct](https://github.com/golangci/golangci-lint?tab=coc-ov-file). ## Set up your machine Golangci-lint is written in [Go](https://go.dev). Prerequisites: - `make` - [Go](https://go.dev/doc/install) Fork and clone [golangci-lint](https://github.com/golangci/golangci-lint) repository. A good way of making sure everything is all right is running the following: ```bash make build ./golangci-lint run -v ``` ## Test your change When you are satisfied with the changes, we suggest you run: ```bash make test ``` Which runs all the linters and tests. ## Create or update parameters for docs Add your new or updated parameters to [.golangci.next.reference.yml](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.next.reference.yml) so they will be shown in the docs ## Submit a pull request Push your branch to your golangci-lint fork and open a pull request against the `main` branch. ## Pull request checks First, please, accept CLA - [CLA assistant](https://cla-assistant.io/) will make a comment on the pull request about it. Also, we run a few checks in CI by using GitHub Actions, you can see them [here](https://github.com/golangci/golangci-lint/blob/HEAD/.github/workflows). ## New releases First, see [our versioning policy](/docs/product/roadmap/#versioning-policy). To make a new release create a tag `vX.Y.Z`. Don't forget to add zero patch version for a new minor release, e.g. `v1.99.0`. A GitHub Action [workflow](https://github.com/golangci/golangci-lint/blob/HEAD/.github/workflows/release.yml) will start building and publishing release after that. After making a release, you need to update GitHub [Action config](https://github.com/golangci/golangci-lint/blob/HEAD/assets/github-action-config.json) by running: ```bash make assets/github-action-config.json ``` ================================================ FILE: docs/content/docs/donate/_index.md ================================================ --- title: Support Us weight: 8 aliases: - /donate/ --- Golangci-lint is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! ❤️ You can support us via: {{< cards class="support-cards" cols=7 >}} {{< card link="https://github.com/sponsors/golangci" title="GitHub Sponsors" subtitle="Credit card" image="/images/github-sponsors.svg" >}} {{< card link="https://opencollective.com/golangci-lint" title="Open Collective" subtitle="Credit card, PayPal, etc." image="/images/open-collective.svg" >}} {{< card link="https://thanks.dev/u/gh/golangci" title="Thanks.dev" subtitle="Credit card" image="/images/thanks-dev.svg" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/formatters/_index.md ================================================ --- title: Formatters weight: 4 excludeSearch: true aliases: - /usage/formatters/ --- To see a list of supported formatters and which formatters are enabled/disabled: ```bash golangci-lint help formatters ``` To see a list of formatters enabled by your configuration, use: ```bash golangci-lint formatters ``` {{< cards cols=2 >}} {{< card link="/docs/welcome/quick-start/#formatting" title="Quick Start" icon="terminal" >}} {{< card link="/docs/configuration/cli/#fmt" title="CLI" icon="terminal" >}} {{< card link="/docs/configuration/file/#formatters-configuration" title="Global Configuration" icon="adjustments" >}} {{< card link="/docs/formatters/configuration/" title="Formatter Settings" icon="adjustments" >}} {{< /cards >}} ## All formatters {{< golangci/items/filter >}} {{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" color="yellow" >}} {{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" color="blue" >}} {{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" color="red" border=true >}} {{< /golangci/items/filter >}} {{< cards >}} {{< golangci/items/cards path="formatters" data="formatters_info" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/formatters/configuration.md ================================================ --- title: Settings weight: 2 --- {{% golangci/items/settings info="formatters_info" settings="formatter_settings" %}} ================================================ FILE: docs/content/docs/linters/_index.md ================================================ --- title: Linters weight: 3 excludeSearch: true aliases: - /usage/linters/ --- To see a list of supported linters and which linters are enabled/disabled: ```bash golangci-lint help linters ``` To see a list of linters enabled by your configuration, use: ```bash golangci-lint linters ``` {{< cards cols=2 >}} {{< card link="/docs/welcome/quick-start/#linting" title="Quick Start" icon="terminal" >}} {{< card link="/docs/configuration/cli/#run" title="CLI" icon="terminal" >}} {{< card link="/docs/configuration/file/#linters-configuration" title="Global Configuration" icon="adjustments" >}} {{< card link="/docs/linters/configuration/" title="Linter Settings" icon="adjustments" >}} {{< /cards >}} ## All Linters {{< golangci/items/filter >}} {{< golangci/items/filter-badge class="gl-filter" data="default" icon="inbox" content="Default" color="indigo" >}} {{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" color="yellow" >}} {{< golangci/items/filter-badge class="gl-filter" data="autofix" icon="sparkles" content="Autofix" color="blue" >}} {{< golangci/items/filter-badge class="gl-filter" data="fast" icon="fast-forward" content="Fast" >}} {{< golangci/items/filter-badge class="gl-filter" data="slow" icon="play" content="Slow" >}} {{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" color="blue" >}} {{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" color="red" border=true >}} {{< /golangci/items/filter >}} {{< cards >}} {{< golangci/items/cards path="linters" data="linters_info" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/linters/configuration.md ================================================ --- title: Settings weight: 2 --- {{% golangci/items/settings info="linters_info" settings="linter_settings" %}} ================================================ FILE: docs/content/docs/linters/false-positives.md ================================================ --- title: False Positives weight: 3 aliases: - /usage/false-positives/ --- False positives are inevitable, but we did our best to reduce their count. If a false positive occurred, you have several choices. ## Specific Linter Excludes Most of the linters have a configuration, sometimes false-positives can be related to a bad configuration of a linter. So it's recommended to check the linter configurations. Otherwise, some linters have dedicated configuration to exclude or disable rules. An example with `staticcheck`: ```yaml linters: settings: staticcheck: checks: - all - '-SA1000' # disable the rule SA1000 - '-SA1004' # disable the rule SA1004 ``` ## Exclude ### Exclude Issue by Text You can use `linters.exclusions.rules` config option for per-path or per-linter configuration. In the following example, all the reports from the linters (`linters`) that contain the text (`text`) are excluded: ```yaml linters: exclusions: rules: - linters: - mnd text: "Magic number: 9" ``` In the following example, all the reports from the linters (`linters`) that originated from the source (`source`) are excluded: ```yaml linters: exclusions: rules: - linters: - lll source: "^//go:generate " ``` In the following example, all the reports that contain the text (`text`) in the path (`path`) are excluded: ```yaml linters: exclusions: rules: - path: path/to/a/file.go text: "string `example` has (\\d+) occurrences, make it a constant" ``` ### Exclude Issues by Path Exclude issues in path by `linters.exclusions.paths` or `linters.exclusions.rules` config options. In the following example, all the reports from the linters (`linters`) that concern the path (`path`) are excluded: ```yaml linters: exclusions: rules: - path: '(.+)_test\.go' linters: - funlen - goconst ``` The opposite, excluding reports **except** for specific paths, is also possible. In the following example, only test files get checked: ```yaml linters: exclusions: rules: - path-except: '(.+)_test\.go' linters: - funlen - goconst ``` In the following example, all the reports related to the files (`paths`) are excluded: ```yaml linters: exclusions: paths: - path/to/a/file.go ``` In the following example, all the reports related to the directories (`paths`) are excluded: ```yaml linters: exclusions: paths: - path/to/a/dir/ ``` ## Nolint Directive To exclude issues from all linters use `//nolint:all`. For example, if it's used inline (not from the beginning of the line) it excludes issues only for this line. ```go var bad_name int //nolint:all ``` To exclude issues from specific linters only: ```go var bad_name int //nolint:wsl,unused ``` To exclude issues for the block of code, use this directive at the beginning of a line: ```go //nolint:all func allIssuesInThisFunctionAreExcluded() *string { // ... } //nolint:govet var ( a int b int ) ``` Also, you can exclude all issues in a file by: ```go //nolint:unparam package pkg ``` You may add a comment explaining or justifying why a `nolint` directive is being used on the same line as the flag itself: ```go //nolint:gocyclo // This legacy function is complex, but the team too busy to simplify it func someLegacyFunction() *string { // ... } ``` You can see more examples of using `nolint` directives in [our tests](https://github.com/golangci/golangci-lint/tree/HEAD/pkg/result/processors/testdata) for it. ### Syntax `nolint` is not regular comment but a directive. > A directive comment is a line matching the regular expression `//(line |extern |export |[a-z0-9]+:[a-z0-9])`. > https://go.dev/doc/comment#syntax This means that no spaces are allowed between: - `//` and `nolint` - `nolint` and `:` - `:` and the name of the linter. Invalid syntax: ```go // nolint // nolint:xxx //nolint :xxx //nolint: xxx ``` Valid syntax: ```go //nolint:xxx ``` ## Exclusion Presets Some exclusions are considered common. To help golangci-lint users, those common exclusions are provided through presets. {{% golangci/exclusion-presets-snippet %}} {{% golangci/exclusion-preset-tables %}} ================================================ FILE: docs/content/docs/plugins/_index.md ================================================ --- title: Plugins weight: 7 --- {{< cards >}} {{< card link="/docs/plugins/module-plugins/" title="Module Plugin System" icon="puzzle" tag="Recommended" tagColor="icon-only:sparkles" >}} {{< card link="/docs/plugins/go-plugins/" title="Go Plugin System" icon="puzzle" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/plugins/go-plugins.md ================================================ --- title: Go Plugin System weight: 2 aliases: - /plugins/go-plugins/ --- {{< callout type="warning" >}} **We recommend using [Module Plugin System](/docs/plugins/module-plugins) instead of the Go Plugin System.** {{< /callout >}} Private linters can be added through [Go's plugin system](https://pkg.go.dev/plugin). For a private linter (which acts as a plugin) to work properly, the plugin as well as the golangci-lint binary **needs to be built for the same environment**. `CGO_ENABLED` is another requirement. This means that `golangci-lint` needs to be built for whatever machine you intend to run it on (cloning the golangci-lint repository and running a `CGO_ENABLED=1 make build` should do the trick for your machine). ## Create a Plugin Your linter must provide one or more `golang.org/x/tools/go/analysis.Analyzer` structs. Your project should also use `go.mod`. All versions of libraries that overlap `golangci-lint` (including replaced libraries) MUST be set to the same version as `golangci-lint`. You can see the versions by running `go version -m golangci-lint`. You'll also need to create a Go file like `plugin/example.go`. This file MUST be in the package `main`, and MUST define an exposed function called `New` with the following signature: ```go func New(conf any) ([]*analysis.Analyzer, error) { // ... } ``` See [plugin/example.go](https://github.com/golangci/example-plugin-linter/blob/HEAD/plugin/example.go) for more info. To build the plugin, from the root project directory, run: ```bash go build -buildmode=plugin plugin/example.go ``` This will create a plugin `*.so` file that can be copied into your project or another well-known location for usage in `golangci-lint`. ## Configure a Plugin If you already have a linter plugin available, you can follow these steps to define its usage in a projects `.golangci.yml` file. An example linter can be found at [here](https://github.com/golangci/example-plugin-linter). If you're looking for instructions on how to configure your own custom linter, they can be found further down. 1. If the project you want to lint does not have one already, copy the [.golangci.yml](https://github.com/golangci/golangci-lint/blob/HEAD/.golangci.yml) to the root directory. 2. Adjust the YAML to appropriate `linters.settings.custom` entries as so: ```yaml {filename=".golangci.yml"} version: "2" linters: settings: custom: example: path: /example.so description: The description of the linter original-url: github.com/golangci/example-linter settings: # Settings are optional. one: Foo two: - name: Bar three: name: Bar ``` That is all the configuration that is required to run a custom linter in your project. Custom linters are enabled by default, but abide by the same rules as other linters. If the 'disable all' option is specified either on command line or in `.golangci.yml` files `linters.default: none`, custom linters will be disabled; they can be re-enabled by adding them to the `linters.enable` list, or providing the enabled option on the command line, `golangci-lint run -Eexample`. The configuration inside the `linters.settings` field of linter has some limitations (these are NOT related to the plugin system itself): we use Viper to handle the configuration, but Viper puts all the keys in lowercase, and `.` cannot be used inside a key. ================================================ FILE: docs/content/docs/plugins/module-plugins.md ================================================ --- title: Module Plugin System weight: 1 aliases: - /plugins/module-plugins/ --- > [!TIP] > An example linter can be found at [here](https://github.com/golangci/example-plugin-module-linter). ## The Automatic Way - Define your building configuration into `.custom-gcl.yml`. - Run the command `golangci-lint custom` (or `golangci-lint custom -v` to have logs). - Define the plugin inside the `linters.settings.custom` section with the type `module`. - Run the resulting custom binary of golangci-lint (`./custom-gcl` by default). Requirements: - Go - git ### Configuration Example ```yaml {filename=".custom-gcl.yml"} version: {{< golangci/latest-version >}} plugins: # a plugin from a Go proxy - module: 'github.com/golangci/plugin1' import: 'github.com/golangci/plugin1/foo' version: v1.0.0 # a plugin from local source - module: 'github.com/golangci/plugin2' path: /my/local/path/plugin2 ``` ```yaml {filename=".golangci.yml"} version: "2" linters: default: none enable: - foo settings: custom: foo: type: "module" description: This is an example usage of a plugin linter. settings: message: hello ``` ## The Manual Way - Add a blank-import of your module inside `cmd/golangci-lint/plugins.go`. - Run `go mod tidy` (the module containing the plugin will be imported). - Run `make build`. - Define the plugin inside the `linters.settings.custom` section with the type `module`. - Run your custom version of golangci-lint. ### Configuration Example ```yaml {filename=".golangci.yml"} version: "2" linters: default: none enable: - foo settings: custom: foo: type: "module" description: This is an example usage of a plugin linter. settings: message: hello ``` ## Reference The configuration file can be validated with the JSON Schema: [custom-gcl.jsonschema.json](https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json) ```yml {filename=".custom-gcl.yml"} {{% golangci/embed file=".tmp/.custom-gcl.reference.yml" %}} ``` ================================================ FILE: docs/content/docs/product/_index.md ================================================ --- title: Product weight: 5 --- {{< cards cols=2 >}} {{< card link="/docs/product/thanks/" title="Thanks" icon="heart" >}} {{< card link="/docs/product/migration-guide/" title="Migration Guide" icon="switch-horizontal" >}} {{< card link="/docs/product/changelog/" title="Changelog" icon="document-text" >}} {{< card link="/docs/product/roadmap/" title="Roadmap" icon="document-text" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/product/changelog-v1.md ================================================ --- title: Changelog v1 excludeSearch: true sidebar: exclude: true --- Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) and on [Bluesky](https://bsky.app/profile/golangci-lint.run). `golangci-lint` is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! {{< golangci/button text="Donate ❤️" link="/docs/donate" >}} {{% golangci/embed file=".tmp/raw_changelog_v1.tmp" %}} ================================================ FILE: docs/content/docs/product/changelog.md ================================================ --- title: Changelog weight: 2 excludeSearch: true aliases: - /product/changelog/ --- Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) and on [Bluesky](https://bsky.app/profile/golangci-lint.run). `golangci-lint` is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! {{< golangci/button text="Donate ❤️" link="/docs/donate" >}} {{% golangci/embed file=".tmp/raw_changelog.tmp" %}} ## v1.x.x {{< cards cols=2 >}} {{< card link="/docs/product/changelog-v1" title="Changelog of golangci-lint v1" icon="collection" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/product/migration-guide.md ================================================ --- title: Migration guide weight: 3 aliases: - /product/migration-guide/ --- ## Command `migrate` You can use golangci-lint to migrate your configuration with the `migrate` command: ```bash golangci-lint migrate ``` Be aware that **comments inside a configuration file are not migrated.** You need to add them manually after the migration. **Deprecated options from v1 or unknown fields are not migrated.** The migration file format is based on the extension of the [configuration file](/docs/configuration/file). The format can be overridden by using the `--format` flag: ```bash golangci-lint migrate --format json ``` Before the migration, the previous configuration file is copied and saved to a file named `.bck.`. By default, before the migration process, the configuration file is validated against the JSON Schema of configuration v1. If you want to skip this validation, you can use the `--skip-validation` flag: ```bash golangci-lint migrate --skip-validation ``` The `migrate` command enforces the following default values: - `run.timeout`: the existing value is ignored because, in v2, there is no timeout by default. - `issues.show-stats`: the existing value is ignored because, in v2, stats are enabled by default. - `run.concurrency`: if the existing value was `0`, it is removed as `0` is the new default. - `run.relative-path-mode`: if the existing value was `cfg`, it is removed as `cfg` is the new default. `issues.exclude-generated` has a new default value (v1 `lax`, v2 `strict`), so this field will be added during the migration to maintain the previous behavior. `issues.exclude-dirs-use-default` has been removed, so it is converted to `linters.exclusions.paths` and, if needed, `formatters.exclusions.paths`. Other fields explicitly defined in the configuration file are migrated even if the value is the same as the default value. The `migrate` command automatically migrates `linters.presets` in individual linters to `linters.enable`. {{% golangci/cli-output cmd="migrate" %}} ## Changes ### `linters` #### `linters.disable-all` This property has been replaced with `linters.default: none`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: disable-all: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: default: none ``` {{< /tab >}} {{< /tabs >}} #### `linters.enable-all` This property has been replaced with `linters.default: all`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: enable-all: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: default: all ``` {{< /tab >}} {{< /tabs >}} #### `linters.enable[].` The linters `gci`, `gofmt`, `gofumpt`, and `goimports` have been moved to the `formatters` section. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: enable: - gci - gofmt - gofumpt - goimports ``` {{< /tab >}} {{< tab >}} ```yaml formatters: enable: - gci - gofmt - gofumpt - goimports ``` {{< /tab >}} {{< /tabs >}} #### `linters.enable[].{stylecheck,gosimple,staticcheck}` The linters `stylecheck`, `gosimple`, and `staticcheck` has been merged inside the `staticcheck`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: enable: - gosimple - staticcheck - stylecheck ``` {{< /tab >}} {{< tab >}} ```yaml linters: enable: - staticcheck ``` {{< /tab >}} {{< /tabs >}} #### `linters.fast` This property has been removed. There are 2 new options (they are not strictly equivalent to the previous option): 1. `linters.default: fast`: set all "fast" linters as the default set of linters. ```yaml linters: default: fast ``` 2. `--fast-only`: filters all enabled linters to keep only "fast" linters. #### `linters.presets` This property has been removed. The `migrate` command automatically migrates `linters.presets` in individual linters to `linters.enable`. {{< tabs items="v1,v2" >}} {{< tab >}} Presets: | name | linters | |------|---------| | bugs | `asasalint`, `asciicheck`, `bidichk`, `bodyclose`, `contextcheck`, `durationcheck`, `errcheck`, `errchkjson`, `errorlint`, `exhaustive`, `gocheckcompilerdirectives`, `gochecksumtype`, `gosec`, `gosmopolitan`, `govet`, `loggercheck`, `makezero`, `musttag`, `nilerr`, `nilnesserr`, `noctx`, `protogetter`, `reassign`, `recvcheck`, `rowserrcheck`, `spancheck`, `sqlclosecheck`, `staticcheck`, `testifylint`, `zerologlint` | | comment | `dupword`, `godot`, `godox`, `misspell` | | complexity | `cyclop`, `funlen`, `gocognit`, `gocyclo`, `maintidx`, `nestif` | | error | `err113`, `errcheck`, `errorlint`, `wrapcheck` | | format | `gci`, `gofmt`, `gofumpt`, `goimports` | | import | `depguard`, `gci`, `goimports`, `gomodguard` | | metalinter | `gocritic`, `govet`, `revive`, `staticcheck` | | module | `depguard`, `gomoddirectives`, `gomodguard` | | performance | `bodyclose`, `fatcontext`, `noctx`, `perfsprint`, `prealloc` | | sql | `rowserrcheck`, `sqlclosecheck` | | style | `asciicheck`, `canonicalheader`, `containedctx`, `copyloopvar`, `decorder`, `depguard`, `dogsled`, `dupl`, `err113`, `errname`, `exhaustruct`, `exptostd`, `forbidigo`, `forcetypeassert`, `ginkgolinter`, `gochecknoglobals`, `gochecknoinits`, `goconst`, `gocritic`, `godot`, `godox`, `goheader`, `gomoddirectives`, `gomodguard`, `goprintffuncname`, `gosimple`, `grouper`, `iface`, `importas`, `inamedparam`, `interfacebloat`, `intrange`, `ireturn`, `lll`, `loggercheck`, `makezero`, `mirror`, `misspell`, `mnd`, `musttag`, `nakedret`, `nilnil`, `nlreturn`, `nolintlint`, `nonamedreturns`, `nosprintfhostport`, `paralleltest`, `predeclared`, `promlinter`, `revive`, `sloglint`, `stylecheck`, `tagalign`, `tagliatelle`, `testpackage`, `tparallel`, `unconvert`, `usestdlibvars`, `varnamelen`, `wastedassign`, `whitespace`, `wrapcheck`, `wsl` | | test | `exhaustruct`, `paralleltest`, `testableexamples`, `testifylint`, `testpackage`, `thelper`, `tparallel`, `usetesting` | | unused | `ineffassign`, `unparam`, `unused` | {{< /tab >}} {{< tab >}} ```yaml # Removed ``` {{< /tab >}} {{< /tabs >}} #### `typecheck` This `typecheck` is not a linter, so it cannot be enabled or disabled: - [FAQ: Why do you have typecheck errors?](/docs/welcome/faq/#why-do-you-have-typecheck-errors) - [FAQ: Why is it not possible to skip/ignore typecheck errors?](/docs/welcome/faq/#why-is-it-not-possible-to-skipignore-typecheck-errors) #### Deprecated Linters The following deprecated linters have been removed: - `deadcode` - `execinquery` - `exhaustivestruct` - `exportloopref` - `golint` - `ifshort` - `interfacer` - `maligned` - `nosnakecase` - `scopelint` - `structcheck` - `tenv` - `varcheck` #### Alternative Linter Names The alternative linters has been removed. | Alt Name v1 | Name v2 | |-------------|---------------| | `gas` | `gosec` | | `goerr113` | `err113` | | `gomnd` | `mnd` | | `logrlint` | `loggercheck` | | `megacheck` | `staticcheck` | | `vet` | `govet` | | `vetshadow` | `govet` | {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: enable: - gas - goerr113 - gomnd - logrlint - megacheck - vet - vetshadow ``` {{< /tab >}} {{< tab >}} ```yaml linters: enable: - gosec - err113 - mnd - loggercheck - staticcheck - govet ``` {{< /tab >}} {{< /tabs >}} ### `linters-settings` The `linters-settings` section has been split into `linters.settings` and `formatters.settings`. Settings for `gci`, `gofmt`, `gofumpt`, and `goimports` are moved to the `formatters.settings` section. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: govet: enable-all: true gofmt: simplify: false ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: govet: enable-all: true formatters: settings: gofmt: simplify: false ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.asasalint.ignore-test` This option has been removed. To ignore test files, use `linters.exclusions.rules`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: asasalint: ignore-test: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: rules: - path: '(.+)_test\.go' linters: - asasalint ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.copyloopvar.ignore-alias` This option has been deprecated since v1.58.0 and has been replaced with `linters.settings.copyloopvar.check-alias`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: copyloopvar: ignore-alias: false ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: copyloopvar: check-alias: true ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.cyclop.skip-tests` This option has been removed. To ignore test files, use `linters.exclusions.rules`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: cyclop: skip-test: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: rules: - path: '(.+)_test\.go' linters: - cyclop ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.errcheck.exclude` This option has been deprecated since v1.42.0 and has been removed. To exclude functions, use `linters.settings.errcheck.exclude-functions` instead. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: errcheck: exclude: ./errcheck_excludes.txt ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: errcheck: exclude-functions: - io.ReadFile - io.Copy(*bytes.Buffer) - io.Copy(os.Stdout) ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.errcheck.ignore` This option has been deprecated since v1.13.0 and has been removed. To exclude functions, use `linters.settings.errcheck.exclude-functions` instead. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: errcheck: ignore: 'io:.*' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: errcheck: exclude-functions: - 'io.ReadFile' - 'io.Copy(*bytes.Buffer)' - 'io.Copy(os.Stdout)' ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.exhaustive.check-generated` This option has been removed. To analyze generated files, use `linters.exclusions.generated`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: exhaustive: check-generated: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: generated: disable ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.forbidigo.forbid[].p` This field has been replaced with `linters-settings.forbidigo.forbid[].pattern`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: forbidigo: forbid: - p: '^fmt\.Print.*$' msg: Do not commit print statements. ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: forbidigo: forbid: - pattern: '^fmt\.Print.*$' msg: Do not commit print statements. ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.forbidigo.forbid[]` The `pattern` has become mandatory for the `forbid` field. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: forbidigo: forbid: - '^print(ln)?$' - '^spew\.(ConfigState\.)?Dump$' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: forbidigo: forbid: - pattern: '^print(ln)?$' - pattern: '^spew\.(ConfigState\.)?Dump$' ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.gci.local-prefixes` This option has been deprecated since v1.44.0 and has been removed. Use `linters.settings.gci.sections` instead. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: gci: local-prefixes: 'github.com/example/pkg' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: gci: sections: - standard - default - prefix(github.com/example/pkg) ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.gci.skip-generated` This option has been removed. To analyze generated files, use `linters.exclusions.generated`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: settings: gci: skip-generated: false ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: generated: disable ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.goconst.ignore-tests` This option has been removed. To ignore test files, use `linters.exclusions.rules`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: goconst: ignore-tests: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: rules: - path: '(.+)_test\.go' linters: - goconst ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.gocritic.settings.ruleguard.rules` The special variable `${configDir}` has been replaced with `${base-path}`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: gocritic: settings: ruleguard: rules: '${configDir}/ruleguard/rules-*.go' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: gocritic: settings: ruleguard: rules: '${base-path}/ruleguard/rules-*.go' ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.govet.check-shadowing` This option has been deprecated since v1.57.0 and has been removed. Use `linters.settings.govet.enable: shadow` instead. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: govet: check-shadowing: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: govet: enable: - shadow ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.misspell.ignore-words` This option has been replaced with `linters.settings.misspell.ignore-rules`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: misspell: ignore-words: - foo ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: misspell: ignore-rules: - foo ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.predeclared.ignore` This string option has been replaced with the slice option with the same name. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: predeclared: ignore: "new,int" ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: predeclared: ignore: - new - int ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.predeclared.q` This option has been replaced with `linters.settings.predeclared.qualified-name`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: predeclared: q: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: predeclared: qualified-name: true ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.revive.ignore-generated-header` This option has been removed. Use `linters.exclusions.generated` instead. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: revive: ignore-generated-header: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: generated: strict ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.sloglint.context-only` This option has been deprecated since v1.58.0 and has been replaced with `linters.settings.sloglint.context`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: sloglint: context-only: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: sloglint: context: all ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.staticcheck.go` This option has been deprecated since v1.47.0 and has been removed. Use `run.go` instead. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: staticcheck: go: '1.22' ``` {{< /tab >}} {{< tab >}} ```yaml run: go: '1.22' ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.unused.exported-is-used` This option has been deprecated since v1.60.0 and has been removed. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: unused: exported-is-used: true ``` {{< /tab >}} {{< tab >}} ```yaml # Removed ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.usestdlibvars.os-dev-null` This option has been deprecated since v1.51.0 and has been removed. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: usestdlibvars: os-dev-null: true ``` {{< /tab >}} {{< tab >}} ```yaml # Removed ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.usestdlibvars.syslog-priority` This option has been deprecated since v1.51.0 and has been removed. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: usestdlibvars: syslog-priority: true ``` {{< /tab >}} {{< tab >}} ```yaml # Removed ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.wrapcheck.ignoreInterfaceRegexps` This option has been renamed to `linters.settings.wrapcheck.ignore-interface-regexps`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: wrapcheck: ignoreInterfaceRegexps: - '^(?i)c(?-i)ach(ing|e)' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: wrapcheck: ignore-interface-regexps: - '^(?i)c(?-i)ach(ing|e)' ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.wrapcheck.ignorePackageGlobs` This option has been renamed to `linters.settings.wrapcheck.ignore-package-globs`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: wrapcheck: ignorePackageGlobs: - 'encoding/*' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: wrapcheck: ignore-package-globs: - 'encoding/*' ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.wrapcheck.ignoreSigRegexps` This option has been renamed to `linters.settings.wrapcheck.ignore-sig-regexps`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: wrapcheck: ignoreSigRegexps: - '\.New.*Error\(' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: wrapcheck: ignore-sig-regexps: - '\.New.*Error\(' ``` {{< /tab >}} {{< /tabs >}} #### `linters-settings.wrapcheck.ignoreSigs` This option has been renamed to `linters.settings.wrapcheck.ignore-sigs`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters-settings: wrapcheck: ignoreSigs: - '.Errorf(' ``` {{< /tab >}} {{< tab >}} ```yaml linters: settings: wrapcheck: ignore-sigs: - '.Errorf(' ``` {{< /tab >}} {{< /tabs >}} ### `issues` #### `issues.exclude-case-sensitive` This property has been removed. `issues.exclude`, `issues.exclude-rules.text`, and `issues.exclude-rules.source` are case-sensitive by default. To ignore case, use `(?i)` at the beginning of a regex syntax. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: exclude-case-sensitive: false exclude: - 'abcdef' ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: rules: - path: '(.+)\.go$' text: (?i)abcdef ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude-dirs-use-default` This property has been removed. Use `linters.exclusions.paths` and `formatters.exclusions.paths` to exclude directories. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: exclude-dirs-use-default: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: paths: - third_party$ - builtin$ - examples$ ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude-dirs` This property has been replaced with `linters.exclusions.paths` and `formatters.exclusions.paths`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: exclude-dirs: - src/external_libs - autogenerated_by_my_lib ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: paths: - src/external_libs - autogenerated_by_my_lib ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude-files` This property has been replaced with `linters.exclusions.paths` and `formatters.exclusions.paths`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: exclude-files: - '.*\.my\.go$' - lib/bad.go ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: paths: - '.*\.my\.go$' - lib/bad.go ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude-generated-strict` This property has been deprecated since v1.59.0 and has been replaced with `linters.exclusions.generated: strict`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: exclude-generated-strict: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: generated: strict ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude-generated` This property has been replaced with `linters.exclusions.generated`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml linters: exclude-generated: lax ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: generated: lax ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude-rules` This property has been replaced with `linters.exclusions.rules`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: exclude-rules: - path: '_test\.go' linters: - gocyclo - errcheck - dupl - gosec - path-except: '_test\.go' linters: - staticcheck - path: internal/hmac/ text: "weak cryptographic primitive" linters: - gosec - linters: - staticcheck text: "SA9003:" - linters: - err113 source: "foo" ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: rules: - path: '_test\.go' linters: - dupl - errcheck - gocyclo - gosec - path-except: '_test\.go' linters: - staticcheck - path: internal/hmac/ text: weak cryptographic primitive linters: - gosec - text: 'SA9003:' linters: - staticcheck - source: foo linters: - err113 ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude-use-default` This property has been replaced with `linters.exclusions.presets`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: exclude-use-default: true ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: presets: - comments - common-false-positives - legacy - std-error-handling ``` {{< /tab >}} {{< /tabs >}} #### `issues.exclude` This property has been replaced with `linters.exclusions.rules`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: exclude: - abcdef ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: rules: - path: '(.+)\.go$' text: abcdef ``` {{< /tab >}} {{< /tabs >}} #### `issues.include` This property has been replaced with `linters.exclusions.presets`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml issues: include: - EXC0014 - EXC0015 ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: presets: - common-false-positives - legacy - std-error-handling ``` {{< /tab >}} {{< /tabs >}} ### `output` #### `output.format` This property has been deprecated since v1.57.0 and has been replaced with `output.formats`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: format: 'checkstyle:report.xml,json:stdout,colored-line-number' ``` {{< /tab >}} {{< tab >}} ```yaml output: formats: checkstyle: path: 'report.xml' json: path: stdout text: path: stdout color: true ``` {{< /tab >}} {{< /tabs >}} #### `output.formats[].format: ` The property `output.formats[].format` has been replaced with `output.formats[].`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: formats: - format: json path: stderr - format: checkstyle path: report.xml ``` {{< /tab >}} {{< tab >}} ```yaml output: formats: json: path: stderr checkstyle: path: report.xml ``` {{< /tab >}} {{< /tabs >}} #### `output.formats[].format: line-number` This format has been replaced by the format `text`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: formats: - format: line-number ``` {{< /tab >}} {{< tab >}} ```yaml output: formats: text: path: stdout ``` {{< /tab >}} {{< /tabs >}} #### `output.formats[].format: colored-line-number` This format has been replaced by the format `text` with the option `colors` (`true` by default). {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: formats: - format: colored-line-number ``` {{< /tab >}} {{< tab >}} ```yaml output: formats: text: path: stdout colors: true ``` {{< /tab >}} {{< /tabs >}} #### `output.formats[].format: colored-tab` This format has been replaced by the format `tab` with the option `colors` (`true` by default). {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: formats: - format: colored-tab ``` {{< /tab >}} {{< tab >}} ```yaml output: formats: tab: path: stdout colors: true ``` {{< /tab >}} {{< /tabs >}} #### `output.print-issued-lines` This property has been removed. To not print the lines with issues, use the `text` format with the option `print-issued-lines: false`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: formats: - format: line-number path: stdout print-issued-lines: false ``` {{< /tab >}} {{< tab >}} ```yaml output: formats: text: path: stdout print-issued-lines: false ``` {{< /tab >}} {{< /tabs >}} #### `output.print-linter-name` This property has been removed. To not print the linter name, use the `text` format with the option `print-linter-name: false`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: formats: - format: line-number path: stdout print-linter-name: false ``` {{< /tab >}} {{< tab >}} ```yaml output: formats: text: path: stdout print-linter-name: false ``` {{< /tab >}} {{< /tabs >}} #### `output.show-stats` This property is `true` by default. #### `output.sort-order` This property has a new default value `['linter', 'file']` instead of `['file']`. #### `output.sort-results` The property has been removed. The output results are always sorted. #### `output.uniq-by-line` This property has been deprecated since v1.63.0 and has been replaced by `issues.uniq-by-line`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml output: uniq-by-line: true ``` {{< /tab >}} {{< tab >}} ```yaml issues: uniq-by-line: true ``` {{< /tab >}} {{< /tabs >}} ### `run` #### `run.go` The new fallback value for this property is `1.22` instead of `1.17`. #### `run.concurrency` This property value set to match Linux container CPU quota by default and fallback on the number of logical CPUs in the machine. #### `run.relative-path-mode` This property has a new default value of `cfg` instead of `wd`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml run: # When not specified, relative-path-mode is set to 'wd' by default ``` {{< /tab >}} {{< tab >}} ```yaml run: relative-path-mode: 'cfg' ``` {{< /tab >}} {{< /tabs >}} #### `run.show-stats` This property has been deprecated since v1.57.0 and has been replaced by `output.show-stats`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml run: show-stats: true ``` {{< /tab >}} {{< tab >}} ```yaml output: show-stats: true ``` {{< /tab >}} {{< /tabs >}} #### `run.skip-dirs-use-default` This property has been deprecated since v1.57.0 and has been replaced by `issues.exclude-dirs-use-default`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml run: skip-dirs-use-default: false ``` {{< /tab >}} {{< tab >}} ```yaml issues: exclude-dirs-use-default: false ``` {{< /tab >}} {{< /tabs >}} #### `run.skip-dirs` This property has been deprecated since v1.57.0 and has been removed. Use `linters.exclusions.paths` and `formatters.exclusions.paths` to exclude directories. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml run: skip-dirs: - src/external_libs - autogenerated_by_my_lib ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: paths: - src/external_libs - autogenerated_by_my_lib ``` {{< /tab >}} {{< /tabs >}} #### `run.skip-files` This property has been deprecated since v1.57.0 and has been removed. Use `linters.exclusions.paths` and `formatters.exclusions.paths` to exclude files. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml run: skip-files: - '.*\.my\.go$' - lib/bad.go ``` {{< /tab >}} {{< tab >}} ```yaml linters: exclusions: paths: - '.*\.my\.go$' - lib/bad.go ``` {{< /tab >}} {{< /tabs >}} #### `run.timeout` This property value is disabled by default (`0`). ### `severity` #### `severity.default-severity` This property has been replaced with `severity.default`. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml severity: default-severity: error ``` {{< /tab >}} {{< tab >}} ```yaml severity: default: error ``` {{< /tab >}} {{< /tabs >}} #### `severity.rules.case-sensitive` `severity.rules.text` and `severity.rules.source` are case-sensitive by default. To ignore case, use `(?i)` at the beginning of a regex syntax. {{< tabs items="v1,v2" >}} {{< tab >}} ```yaml severity: case-sensitive: true rules: - severity: info linters: - foo text: 'Example.*' ``` {{< /tab >}} {{< tab >}} ```yaml severity: rules: - severity: info linters: - foo text: '(?i)Example.*' ``` {{< /tab >}} {{< /tabs >}} ### `version` The `version` property has been added to the configuration file. ```yaml version: "2" ``` ### Integration #### Visual Studio Code {{< tabs items="v1,v2" >}} {{< tab >}} ```JSONata "go.lintTool": "golangci-lint", "go.lintFlags": [ "--fast" ] ``` {{< /tab >}} {{< tab >}} ```JSONata "go.lintTool": "golangci-lint", "go.lintFlags": [ "--fast-only" ], "go.formatTool": "custom", "go.alternateTools": { "customFormatter": "golangci-lint" }, "go.formatFlags": [ "fmt", "--stdin" ] ``` {{< /tab >}} {{< /tabs >}} ### Command Line Flags The following flags have been removed: - `--disable-all` - `--enable-all` - `-p, --presets` - `--fast` - `-e, --exclude` - `--exclude-case-sensitive` - `--exclude-dirs-use-default` - `--exclude-dirs` - `--exclude-files` - `--exclude-generated` - `--exclude-use-default` - `--go string` - `--sort-order` - `--sort-results` - `--out-format` - `--print-issued-lines` - `--print-linter-name` #### `--out-format` `--out-format` has been replaced with the following flags: ```bash # Previously 'colored-line-number' and 'line-number' --output.text.path --output.text.print-linter-name --output.text.print-issued-lines --output.text.colors ``` ```bash # Previously 'json' --output.json.path ``` ```bash # Previously 'colored-tab' and 'tab' --output.tab.path --output.tab.print-linter-name --output.tab.colors ``` ```bash # Previously 'html' --output.html.path ``` ```bash # Previously 'checkstyle' --output.checkstyle.path ``` ```bash # Previously 'code-climate' --output.code-climate.path ``` ```bash # Previously 'junit-xml' and 'junit-xml-extended' --output.junit-xml.path --output.junit-xml.extended ``` ```bash # Previously 'teamcity' --output.teamcity.path ``` ```bash # Previously 'sarif' --output.sarif.path ``` #### `--print-issued-lines` `--print-issued-lines` has been replaced with `--output.text.print-issued-lines`. #### `--print-linter-name` `--print-linter-name` has been replaced with `--output.text.print-linter-name` or `--output.tab.print-linter-name`. #### `--disable-all` and `--enable-all` `--disable-all` has been replaced with `--default=none`. `--enable-all` has been replaced with `--default=all`. #### Examples Run only the `govet` linter, output results to stdout in JSON format, and sort results: {{< tabs items="v1,v2" >}} {{< tab >}} ```bash golangci-lint run --disable-all --enable=govet --out-format=json --sort-order=linter --sort-results ``` {{< /tab >}} {{< tab >}} ```bash golangci-lint run --default=none --enable=govet --output.json.path=stdout ``` {{< /tab >}} {{< /tabs >}} Do not print issued lines, output results to stdout without colors in text format, and to `gl-code-quality-report.json` file in Code Climate's format: {{< tabs items="v1,v2" >}} {{< tab >}} ```bash golangci-lint run --print-issued-lines=false --out-format code-climate:gl-code-quality-report.json,line-number ``` {{< /tab >}} {{< tab >}} ```bash golangci-lint run --output.text.path=stdout --output.text.colors=false --output.text.print-issued-lines=false --output.code-climate.path=gl-code-quality-report.json ``` {{< /tab >}} {{< /tabs >}} ================================================ FILE: docs/content/docs/product/roadmap.md ================================================ --- title: Roadmap weight: 4 aliases: - /product/roadmap/ --- ## 💡 Feature Requests Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on. [See Feature Requests](https://github.com/golangci/golangci-lint/issues?utf8=✓&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement) ## 🐛 Bugs Please file an issue for bugs, missing documentation or unexpected behavior. [See Bugs](https://github.com/golangci/golangci-lint/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3A%22bug%22+sort%3Acreated-desc) ## Versioning Policy golangci-lint follows [semantic versioning](https://semver.org). However, due to the nature of golangci-lint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy: - Patch release (intended to not break your lint build) - A patch version update in a specific linter that results in golangci-lint reporting fewer errors. - A bug fix to the CLI or core (packages loading, runner, postprocessors, etc). - Improvements to documentation. - Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage. - Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone). - Minor release (might break your lint build because of newly found issues) - A major or minor version update of a specific linter that results in golangci-lint reporting more errors. - A new linter is added. - An existing configuration option or linter is deprecated. - A new CLI command is created. - Backward incompatible change of configuration. - Major release (likely to break your lint build) - Backward incompatible change of configuration with huge impact. According to our policy, any minor update may report more errors than the previous release (ex: from a bug fix). As such, we recommend using the fixed minor version and fixed or the latest patch version to guarantee the results of your builds. For example, in our [GitHub Action](https://github.com/golangci/golangci-lint-action) we require users to explicitly set the minor version of golangci-lint and we always use the latest patch version. ## Linter Deprecation Cycle A linter can be deprecated for various reasons, e.g. the linter stops working with a newer version of Go or the author has abandoned its linter. The deprecation of a linter will follow 3 phases: 1. **Display of a warning message**: The linter can still be used (unless it's completely non-functional), but it's recommended to remove it from your configuration. 2. **Display of an error message**: At this point, you should remove the linter. The original implementation is replaced by a placeholder that does nothing. The linter is NOT enabled when using `default: all` and should be removed from the `disable` option. 3. **Removal of the linter** from golangci-lint. Each phase corresponds to a minor version: - v1.0.0 -> warning message - v1.1.0 -> error message - v1.2.0 -> linter removed We will provide clear information about those changes on different supports: changelog, logs, social network, etc. We consider the removal of a linter as non-breaking changes for golangci-lint itself. No major version will be created when a linter is removed. ## Future Plans 1. Upstream all changes of forked linters. 2. Make it easy to write own linter/checker: it should take a minimum code, have perfect documentation, debugging and testing tooling. 3. Speed up SSA loading: on-disk cache and existing code profiling-optimizing. 4. Analyze (don't only filter) only new code: analyze only changed files and dependencies, make incremental analysis, caches. 5. Smart new issues detector: don't print existing issues on changed lines. 6. Minimize false-positives by fixing linters and improving testing tooling. 7. Documentation for every issue type. ================================================ FILE: docs/content/docs/product/thanks.md ================================================ --- title: Thanks weight: 1 aliases: - /product/thanks/ --- ## ❤️ ### Thanks to developers and authors of used linters {{< cards class="author-cards" cols=7 >}} {{< golangci/authors >}} {{< /cards >}} ### Thanks to all contributors [![golangci-lint contributors](https://opencollective.com/golangci-lint/contributors.svg?width=890&button=false&skip=golangcidev,CLAassistant,renovate,fossabot,golangcibot,kortschak,golangci-releaser,dependabot%5Bbot%5D)](https://github.com/golangci/golangci-lint/graphs/contributors) ### Special thanks Thanks to Ludovic Fernandez ([@ldez](https://github.com/ldez)) for actively maintaining the golangci-lint project. Thanks to Denis Isaev ([@jirfag](https://github.com/jirfag)) for creating golangci-lint and the GitHub Action [golangci-lint-action](https://github.com/golangci/golangci-lint-action). Thanks to Alec Thomas ([@alecthomas](https://github.com/alecthomas)) and [alecthomas/gometalinter](https://github.com/alecthomas/gometalinter) for inspiration and amazing work. Thanks to Bradley Falzon ([@bradleyfalzon](https://github.com/bradleyfalzon)) and [bradleyfalzon/revgrep](https://github.com/bradleyfalzon/revgrep) for cool diff tool. The golangci-lint logo is inspired by the Go gopher designed by Renee French [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). ================================================ FILE: docs/content/docs/welcome/_index.md ================================================ --- title: Welcome weight: 1 --- This quickstart guide provides step-by-step instructions to help you install, configure, and begin using `golangci-lint` efficiently. {{< cards >}} {{< card link="/docs/welcome/install/local" title="Local Installation" icon="archive" >}} {{< card link="/docs/welcome/install/ci" title="CI Installation" icon="archive" >}} {{< card link="/docs/welcome/integrations/" title="Integrations" icon="sparkles" >}} {{< card link="/docs/welcome/quick-start/#linting" title="Quick Start: Linting" icon="fast-forward" >}} {{< card link="/docs/welcome/quick-start/#formatting" title="Quick Start: Formatting" icon="fast-forward" >}} {{< card link="/docs/welcome/faq/" title="FAQ" icon="question-mark-circle" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/welcome/faq.md ================================================ --- title: FAQ toc: false weight: 5 aliases: - /welcome/faq/ --- ## Which Go versions are supported? The same as the Go team (the 2 latest minor versions). Basically, golangci-lint supports Go versions lower or equal to the Go version used to compile it. New versions of Go are not automatically supported because, in addition to the Go version used to build it, some linters and/or internal pieces of golangci-lint could need to be adapted to support this new Go version. ## How to use golangci-lint in CI Run golangci-lint in CI and check the exit code. If it's non-zero - fail the build. See [how to properly install golangci-lint in CI](/docs/welcome/install/ci) ## golangci-lint doesn't work 1. Please ensure you are using the latest binary release. 2. Run it with `-v` option and check the output. 3. If it doesn't help, create a [GitHub issue](https://github.com/golangci/golangci-lint/issues/new/choose) with the output from the error and #2 above. ## Why do you have `typecheck` errors? `typecheck` is like a front-end for the Go compiler errors. Compilation errors are identified/labeled as reports of `typecheck` but they are not produced by a linter called `typecheck`. `typecheck` is not a linter, it doesn't perform any analysis, it's just a way to identify, parse, and display compiling errors (produced by the `types.Checker`) and some linter errors. It cannot be disabled because of that. Of course, this is just as good as the compiler itself, and a lot of compilation issues will not properly show where in the code your error lies. As a consequence, the code to analyze should compile. It means that if you try to run an analysis on a single file or a group of files or a package or a group of packages, with dependencies on other files or packages of your project, as it doesn't compile (because of the missing pieces of code), it also cannot be analyzed. If there are `typecheck` errors, golangci-lint will not be able to produce other reports because that kind of error doesn't allow it to perform any analysis. How to troubleshoot: 1. Ensure the version of golangci-lint is built with a compatible version of Go (`golangci-lint version`). 2. Ensure dependencies are up to date with `go mod tidy`. 3. Ensure building works with `go run ./...`/`go build ./...` - whole package. 4. Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements. 5. If using CGO, ensure all required system libraries are installed. 6. If you are using private repositories/dependencies, ensure the [Go proxy](https://go.dev/ref/mod#module-proxy) (`GOPROXY`) and [checksum database](https://go.dev/ref/mod#checksum-database) (`GOSUMDB`) are right and/or your git configuration. ## Why is it not possible to skip/ignore `typecheck` errors? For mainly the same reasons that you cannot compile when you have a compiler error. `typecheck` errors are reported in the same style as linter reports/issues, but are completely different because they are related to problems that block the analysis (`typecheck` is not a linter). When there are `typecheck` errors, most linters are not able to perform the analysis, and they simply do not produce any reports, so it's not possible to skip/ignore `typecheck` errors. ## Why running with `--fast-only` can be slow on the first run? Because the first run caches type information. All subsequent runs will be faster. Usually this option is used during development on a local machine and compilation was already performed. ## How do you add a custom linter? You can integrate it yourself, see this [manual](/docs/contributing/new-linters/). Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml) and we will integrate when time permits. ## How to integrate golangci-lint into a large project with thousands of issues We are sure that every project can easily integrate golangci-lint, even the large one. The idea is to not fix all existing issues. Fix only newly added issue: issues in new code. To do this, set up the CI to run golangci-lint with options `--new-from-merge-base=main` or `--new-from-rev=HEAD~1`. Also, take a look at option `--new`, but consider that CI scripts that generate unstaged files will make `--new` only point out issues in those files and not in the last commit. In that regard `--new-from-merge-base=main` or `--new-from-rev=HEAD~1` are safer. By doing this you won't create new issues in your code and can choose to fix existing issues (or not). ## Why `--new-from-xxx` don't seem to be working in some cases? The options `--new-from-merge-base`, `--new-from-rev`, and `--new-from-patch` work by comparing `git diff` output and issues. If an issue is not reported as the same line as the changes then the issue will be skipped. This is because the line of the issue is not inside the lines changed. To fix that, you have to use the option `--whole-files`. The side effect is the issues inside the file that contain changes but not directly related to the changes themselves will be reported. ================================================ FILE: docs/content/docs/welcome/install/_index.md ================================================ --- title: "Install" weight: 1 aliases: - /welcome/install/ --- Where do you want to install golangci-lint? {{< cards >}} {{< card link="/docs/welcome/install/local" title="On my machine" icon="archive" >}} {{< card link="/docs/welcome/install/ci" title="On CI/CD systems" icon="archive" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/welcome/install/ci.md ================================================ --- title: "CI Installation" weight: 3 --- It's important to have reproducible CI: don't start to fail all builds at the same time. With golangci-lint this can happen if you use option `linters.default: all` and a new linter is added or even without `linters.default: all` when one upstream linter is upgraded. > [!IMPORTANT] > It's highly recommended installing a specific version of golangci-lint available on the [releases page](https://github.com/golangci/golangci-lint/releases). ## GitHub Actions We recommend using [our GitHub Action](https://github.com/golangci/golangci-lint-action) for running golangci-lint in CI for GitHub projects. It's [fast and uses smart caching](https://github.com/golangci/golangci-lint-action#performance) inside, and it can be much faster than the simple binary installation. Also, the action creates GitHub annotations for found issues (you don't need to dig into build log to see found by golangci-lint issues). {{< cards cols=2 >}} {{< golangci/image-card src="/images/colored-line-number.png" title="Console Output" >}} {{< golangci/image-card src="/images/annotations.png" title="Annotations" >}} {{< /cards >}} ## GitLab CI GitLab provides a [guide for integrating golangci-lint into the Code Quality widget](https://docs.gitlab.com/ci/testing/code_quality/#golangci-lint). A simple quickstart is their [CI component](https://gitlab.com/explore/catalog/components/code-quality-oss/codequality-os-scanners-integration), which can be used like this: ```yaml {filename=".gitlab-ci.yml"} include: - component: $CI_SERVER_FQDN/components/code-quality-oss/codequality-os-scanners-integration/golangci@1.0.1 ``` Note that you [can only reference components in the same GitLab instance as your project](https://docs.gitlab.com/ci/components/#use-a-component) ## Buildkite Buildkite provides a [plugin](https://buildkite.com/resources/plugins/buildkite-plugins/golangci-lint-buildkite-plugin/) for running golangci-lint in Buildkite pipelines. It utilizes the [Docker image of golangci-lint](/docs/welcome/install/local/#docker) by default, but can be set to use a binary if available on the agent. The plugin will annotate builds with results, providing an easily readable summary of fixes. ```yaml {filename=".pipeline.yml"} plugins: - golangci-lint#v1.0.0: config: .golangci.yml ``` ## Other CI Here are the other ways to install golangci-lint: {{< cards >}} {{< card link="/docs/welcome/install/local/#binaries" title="Bash/Binaries" icon="archive" >}} {{< card link="/docs/welcome/install/local/#docker" title="Docker" icon="archive" >}} {{< /cards >}} ================================================ FILE: docs/content/docs/welcome/install/local.md ================================================ --- title: "Local Installation" weight: 2 --- ## Binaries ```bash # binary will be $(go env GOPATH)/bin/golangci-lint curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b $(go env GOPATH)/bin {{< golangci/latest-version >}} # or install it into ./bin/ curl -sSfL https://golangci-lint.run/install.sh | sh -s {{< golangci/latest-version >}} # In Alpine Linux (as it does not come with curl by default) wget -O- -nv https://golangci-lint.run/install.sh | sh -s {{< golangci/latest-version >}} golangci-lint --version ``` On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win). ## Linux Golangci-lint is available inside the majority of the package managers. {{% details closed="true" title="Packaging status" %}} [![Packaging status](https://repology.org/badge/vertical-allrepos/golangci-lint.svg)](https://repology.org/project/golangci-lint/versions) {{% /details %}} ## macOS ### Homebrew Note: Homebrew can use an unexpected version of Go to build the binary, so we recommend either using our binaries or ensuring the version of Go used to build. You can install a binary release on macOS using [brew](https://brew.sh/): ```bash brew install golangci-lint brew upgrade golangci-lint ``` Note: Previously, we used a [Homebrew tap](https://github.com/golangci/homebrew-tap). We recommend using the [official formula](https://formulae.brew.sh/formula/golangci-lint) instead of the tap, but sometimes the most recent release isn't immediately available via Homebrew core due to manual updates that need to occur from Homebrew core maintainers. In this case, the tap formula, which is updated automatically, can be used to install the latest version of golangci-lint: ```bash brew tap golangci/tap brew install golangci/tap/golangci-lint ``` ### MacPorts It can also be installed through [MacPorts](https://www.macports.org/) The MacPorts installation mode is community-driven and not officially maintained by the golangci team. ```bash sudo port install golangci-lint ``` ## Windows ### Chocolatey You can install a binary on Windows using [chocolatey](https://community.chocolatey.org/packages/golangci-lint). ```bash choco install golangci-lint ``` ### Scoop You can install a binary on Windows using [scoop](https://scoop.sh). ```bash scoop install main/golangci-lint ``` The scoop package is not officially maintained by golangci team. ## Docker The Docker image is available on [Docker Hub](https://hub.docker.com/r/golangci/golangci-lint). ```bash docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< golangci/latest-version >}} golangci-lint run ``` Colored output: ```bash docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{{< golangci/latest-version >}} golangci-lint run ``` Preserving caches between consecutive runs: ```bash docker run --rm -t -v $(pwd):/app -w /app \ --user $(id -u):$(id -g) \ -v $(go env GOCACHE):/.cache/go-build -e GOCACHE=/.cache/go-build \ -v $(go env GOMODCACHE):/.cache/mod -e GOMODCACHE=/.cache/mod \ -v ~/.cache/golangci-lint:/.cache/golangci-lint -e GOLANGCI_LINT_CACHE=/.cache/golangci-lint \ golangci/golangci-lint:{{< golangci/latest-version >}} golangci-lint run ``` ## mise Note: `mise` is using the [aqua](https://aquaproj.github.io/) backend for this tool, so binaries installed came from GitHub assets (recommended). You can install golangci-lint by using [`mise`](https://github.com/jdx/mise). ```bash mise use -g golangci-lint@{{< golangci/latest-version >}} ``` The `mise` integration is not officially maintained by golangci team. ## Install from Sources > [!WARNING] > Using `go install`/`go get`, "tools pattern", and `tool` command/directives installations aren't guaranteed to work. > We recommend using binary installation. These installations aren't recommended because of the following points: 1. These installations compile golangci-lint locally. The Go version used to build will depend on your local Go version. 2. Some users use the `-u` flag for `go get`, which upgrades our dependencies. The resulting binary was not tested and is not guaranteed to work. 3. When using the "tools pattern" or `tool` command/directives, the dependencies of a tool can modify the dependencies of another tool or your project. The resulting binary was not tested and is not guaranteed to work. 4. We've encountered issues with Go module hashes due to the unexpected recreation of dependency tags. 5. `go.mod` replacement directives don't apply transitively. It means a user will be using a patched version of golangci-lint if we use such replacements. 6. It allows installation from the main branch, which can't be considered stable. 7. It's slower than binary installation. ```bash go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{< golangci/latest-version >}} ``` {{% details title="`go tool` usage recommendations" closed="true" %}} > [!WARNING] > We don't recommend using `go tool`. But if you want to use `go tool` to install and run golangci-lint (**once again we don't recommend that**), the best approach is to use a dedicated module or module file to isolate golangci-lint from other tools or dependencies. This approach avoids modifying your project dependencies and the golangci-lint dependencies. > [!CAUTION] > You should never update golangci-lint dependencies manually. **Method 1: dedicated module file** ```sh # Create a dedicated module file go mod init -modfile=golangci-lint.mod /golangci-lint # Example: go mod init -modfile=golangci-lint.mod github.com/org/repo/golangci-lint ``` ```sh # Add golangci-lint as a tool go get -tool -modfile=golangci-lint.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{< golangci/latest-version >}} ``` ```sh # Run golangci-lint as a tool go tool -modfile=golangci-lint.mod golangci-lint run ``` ```sh # Update golangci-lint go get -tool -modfile=golangci-lint.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest ``` **Method 2: dedicated module** ```sh # Create a dedicated directory mkdir golangci-lint ``` ```sh # Create a dedicated module file go mod init -modfile=tools/go.mod /golangci-lint # Example: go mod init -modfile=golangci-lint/go.mod github.com/org/repo/golangci-lint ``` ```sh # Setup a Go workspace go work init . golangci-lint ``` ```sh # Add golangci-lint as a tool go get -tool -modfile=golangci-lint/go.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint ``` ```sh # Run golangci-lint as a tool go tool golangci-lint run ``` ```sh # Update golangci-lint go get -tool -modfile=golangci-lint/go.mod github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest ``` {{% /details %}} ================================================ FILE: docs/content/docs/welcome/integrations.md ================================================ --- title: Integrations weight: 3 aliases: - /welcome/integrations/ --- ## Editor Integration ### GoLand Starting from version 2025.1, GoLand has built-in support of golangci-lint. For IntelliJ IDEA with the Go plugin, please install the [plugin](https://plugins.jetbrains.com/plugin/12496-go-linter). Both v1 and v2 versions are supported. ### Visual Studio Code Install the [extension](https://marketplace.visualstudio.com/items?itemName=golang.Go). {{% details title="Recommended settings for those who installed golangci-lint manually" closed="true" %}} ```JSONata "go.lintTool": "golangci-lint", "go.lintFlags": [ "--path-mode=abs", "--fast-only" ], "go.formatTool": "custom", "go.alternateTools": { "customFormatter": "golangci-lint" }, "go.formatFlags": [ "fmt", "--stdin" ] ``` Using it in an editor without `--fast-only` can freeze your editor. Golangci-lint automatically discovers the `.golangci.yml` config for the edited file, so you don't need to configure it in VS Code settings. {{% /details %}} {{% details title="Recommended settings for those who installed golangci-lint via extension" closed="true" %}} Install `golangci-lint-v2` via the `Go: Install/Update Tools` command after setting these configs. This will enable golangci-lint v1 to co-exist with v2. And use the following settings: ```JSONata "go.lintTool": "golangci-lint-v2", "go.lintFlags": [ "--path-mode=abs", "--fast-only" ], "go.formatTool": "custom", "go.alternateTools": { "customFormatter": "golangci-lint-v2" }, "go.formatFlags": [ "fmt", "--stdin" ] ``` Using it in an editor without `--fast-only` can freeze your editor. Golangci-lint automatically discovers the `.golangci.yml` config for the edited file, so you don't need to configure it in VS Code settings. {{% /details %}} ### GNU Emacs There are available plugins: - [Spacemacs](https://github.com/syl20bnr/spacemacs/blob/develop/layers/+lang/go/README.org#linting) - [Flycheck checker](https://github.com/weijiangan/flycheck-golangci-lint) ### Vim The following plugins support golangci-lint: - [vim-go](https://github.com/fatih/vim-go) - [ALE](https://github.com/w0rp/ale) ### LSP Server [golangci-lint-langserver](https://github.com/nametake/golangci-lint-langserver) (NeoVim, Vim, Emacs, ...) ### Sublime Text There is a [plugin](https://github.com/SublimeLinter/SublimeLinter-golangcilint) for SublimeLinter. ## Shell Completion Golangci-lint can generate Bash, fish, PowerShell, and Zsh completion files. See the instructions on `golangci-lint completion --help` (replace `` with your favorite one). {{% details title="Bash & macOS" closed="true" %}} There are two versions of `bash-completion`, v1 and v2. V1 is for Bash 3.2 (which is the default on macOS), and v2 is for Bash 4.1+. The golangci-lint completion script doesn’t work correctly with bash-completion v1 and Bash 3.2. It requires bash-completion v2 and Bash 4.1+. Thus, to be able to correctly use golangci-lint completion on macOS, you have to install and use Bash 4.1+ ([instructions](https://itnext.io/upgrading-bash-on-macos-7138bd1066ba)). The following instructions assume that you use Bash 4.1+ (that is, any Bash version of 4.1 or newer). Install `bash-completion v2`: ```bash brew install bash-completion@2 echo 'export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d"' >>~/.bashrc echo '[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"' >>~/.bashrc exec bash # reload and replace (if it was updated) shell type _init_completion && echo "completion is OK" # verify that bash-completion v2 is correctly installed ``` Add golangci-lint bash completion: ```bash echo 'source <(golangci-lint completion bash)' >>~/.bashrc source ~/.bashrc ``` {{% /details %}} ## CI Integration Check out our [documentation for CI integrations](/docs/welcome/install#ci-installation). ================================================ FILE: docs/content/docs/welcome/quick-start.md ================================================ --- title: Quick Start weight: 2 aliases: - /welcome/quick-start/ --- ## Linting To run golangci-lint: ```bash golangci-lint run ``` It's an equivalent of: ```bash golangci-lint run ./... ``` You can choose which directories or files to analyze: ```bash golangci-lint run dir1 dir2/... golangci-lint run file1.go ``` Directories are NOT analyzed recursively. To analyze them recursively append `/...` to their path. It's not possible to mix files and packages/directories, and files must come from the same package. Golangci-lint can be used with zero configuration. By default, the following linters are enabled: {{% golangci/cli-output section="defaultEnabledLinters" cmd="help linters" %}} Pass `-E/--enable` to enable linter and `-D/--disable` to disable: ```bash golangci-lint run --default=none -E errcheck ``` More information about available linters can be found in the [linters page](/docs/linters/). ## Formatting To format your code: ```bash golangci-lint fmt ``` You can choose which directories or files to analyze: ```bash golangci-lint fmt dir1 dir2/... golangci-lint fmt file1.go ``` More information about available formatters can be found in the [formatters page](/docs/formatters/). ================================================ FILE: docs/data/cli_help.json ================================================ { "defaultEnabledLinters": "Enabled by default linters:\nerrcheck: Errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases.\ngovet: Vet examines Go source code and reports suspicious constructs. It is roughly the same as 'go vet' and uses its passes. [auto-fix]\nineffassign: Detects when assignments to existing variables are not used. [fast]\nstaticcheck: It's the set of rules from staticcheck. [auto-fix]\nunused: Checks Go code for unused constants, variables, functions and types.", "rootOutput": "Smart, fast linters runner.\n\nUsage:\n golangci-lint [flags]\n golangci-lint [command]\n\nAvailable Commands:\n cache Cache control and information.\n completion Generate the autocompletion script for the specified shell\n config Configuration file information and verification.\n custom Build a version of golangci-lint with custom linters.\n fmt Format Go source files.\n formatters List current formatters configuration.\n help Display extra help\n linters List current linters configuration.\n migrate Migrate configuration file from v1 to v2.\n run Lint the code.\n version Display the golangci-lint version.\n\nFlags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n --version Print version\n\nUse \"golangci-lint [command] --help\" for more information about a command.\n", "runOutput": "Lint the code.\n\nUsage:\n golangci-lint run [flags]\n\nFlags:\n -c, --config PATH Read config from file path PATH\n --no-config Don't read config file\n --default string Default set of linters to enable (default \"standard\")\n -D, --disable strings Disable specific linter\n -E, --enable strings Enable specific linter\n --enable-only strings Override linters configuration section to only run the specific linter(s)\n --fast-only Filter enabled linters to run only fast linters\n -j, --concurrency int Number of CPUs to use (Default: Automatically set to match Linux container CPU quota and fall back to the number of logical CPUs in the machine)\n --modules-download-mode string Modules download mode. If not empty, passed as -mod=\u003cmode\u003e to go tools\n --issues-exit-code int Exit code when issues were found (default 1)\n --build-tags strings Build tags\n --timeout duration Timeout for total work. Disabled by default\n --tests Analyze tests (*_test.go) (default true)\n --allow-parallel-runners Allow multiple parallel golangci-lint instances running.\n If false (default) - golangci-lint acquires file lock on start.\n --allow-serial-runners Allow multiple golangci-lint instances running, but serialize them around a lock.\n If false (default) - golangci-lint exits with an error if it fails to acquire file lock on start.\n --path-prefix string Path prefix to add to output\n --path-mode string Path mode to use (empty, or 'abs')\n --show-stats Show statistics per linter (default true)\n --output.text.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.text.print-linter-name Print linter name in the end of issue text. (default true)\n --output.text.print-issued-lines Print lines of code with issue. (default true)\n --output.text.colors Use colors. (default true)\n --output.json.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.tab.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.tab.print-linter-name Print linter name in the end of issue text. (default true)\n --output.tab.colors Use colors. (default true)\n --output.html.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.checkstyle.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.code-climate.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.junit-xml.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.junit-xml.extended Support extra JUnit XML fields.\n --output.teamcity.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --output.sarif.path stdout Output path can be either stdout, `stderr` or path to the file to write to.\n --max-issues-per-linter int Maximum issues count per one linter. Set to 0 to disable (default 50)\n --max-same-issues int Maximum count of issues with the same text. Set to 0 to disable (default 3)\n --uniq-by-line Make issues output unique by line (default true)\n -n, --new Show only new issues: if there are unstaged changes or untracked files, only those changes are analyzed, else only changes in HEAD~ are analyzed.\n It's a super-useful option for integration of golangci-lint into existing large codebase.\n It's not practical to fix all existing issues at the moment of integration: much better to not allow issues in new code.\n For CI setups, prefer --new-from-rev=HEAD~, as --new can skip linting the current patch if any scripts generate unstaged files before golangci-lint runs.\n --new-from-rev REV Show only new issues created after git revision REV\n --new-from-patch PATH Show only new issues created in git patch with file path PATH\n --new-from-merge-base string Show only new issues created after the best common ancestor (merge-base against HEAD)\n --whole-files Show issues in any part of update files (requires new-from-rev or new-from-patch)\n --fix Apply the fixes detected by the linters and formatters (if it's supported by the linter)\n --cpu-profile-path string Path to CPU profile output file\n --mem-profile-path string Path to memory profile output file\n --trace-path string Path to trace output file\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n", "lintersOutput": "List current linters configuration.\n\nUsage:\n golangci-lint linters [flags]\n\nFlags:\n -c, --config PATH Read config from file path PATH\n --no-config Don't read config file\n --default string Default set of linters to enable (default \"standard\")\n -D, --disable strings Disable specific linter\n -E, --enable strings Enable specific linter\n --enable-only strings Override linters configuration section to only run the specific linter(s)\n --fast-only Filter enabled linters to run only fast linters\n --json Display as JSON\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n", "fmtOutput": "Format Go source files.\n\nUsage:\n golangci-lint fmt [flags]\n\nFlags:\n -c, --config PATH Read config from file path PATH\n --no-config Don't read config file\n -E, --enable strings Enable specific formatter\n -d, --diff Display diffs instead of rewriting files\n --diff-colored Display diffs instead of rewriting files (with colors)\n --stdin Use standard input for piping source files\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n", "formattersOutput": "List current formatters configuration.\n\nUsage:\n golangci-lint formatters [flags]\n\nFlags:\n -c, --config PATH Read config from file path PATH\n --no-config Don't read config file\n -E, --enable strings Enable specific formatter\n --json Display as JSON\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n", "helpOutput": "Display extra help\n\nUsage:\n golangci-lint help [flags]\n golangci-lint help [command]\n\nAvailable Commands:\n formatters Display help for formatters.\n linters Display help for linters.\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n\nUse \"golangci-lint help [command] --help\" for more information about a command.\n", "migrateOutput": "Migrate configuration file from v1 to v2.\n\nUsage:\n golangci-lint migrate [flags]\n\nFlags:\n -c, --config PATH Read config from file path PATH\n --no-config Don't read config file\n --format string Output file format.\n By default, the format of the input configuration file is used.\n It can be 'yml', 'yaml', 'toml', or 'json'.\n --skip-validation Skip validation of the configuration file against the JSON Schema for v1.\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n", "configOutput": "Configuration file information and verification.\n\nUsage:\n golangci-lint config [flags]\n golangci-lint config [command]\n\nAvailable Commands:\n path Print used configuration path.\n verify Verify configuration against JSON schema.\n\nFlags:\n -c, --config PATH Read config from file path PATH\n --no-config Don't read config file\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n\nUse \"golangci-lint config [command] --help\" for more information about a command.\n", "customOutput": "Build a version of golangci-lint with custom linters.\n\nUsage:\n golangci-lint custom [flags]\n\nFlags:\n --destination string The directory path used to store the custom binary\n --name string The name of the custom binary\n --version string The golangci-lint version used to build the custom binary\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n", "cacheOutput": "Cache control and information.\n\nUsage:\n golangci-lint cache [flags]\n golangci-lint cache [command]\n\nAvailable Commands:\n clean Clean cache\n status Show cache status\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n\nUse \"golangci-lint cache [command] --help\" for more information about a command.\n", "versionOutput": "Display the golangci-lint version.\n\nUsage:\n golangci-lint version [flags]\n\nFlags:\n --debug Add build information\n --json Display as JSON\n --short Display only the version number\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n", "completionOutput": "Generate the autocompletion script for golangci-lint for the specified shell.\nSee each sub-command's help for details on how to use the generated script.\n\nUsage:\n golangci-lint completion [command]\n\nAvailable Commands:\n bash Generate the autocompletion script for bash\n fish Generate the autocompletion script for fish\n powershell Generate the autocompletion script for powershell\n zsh Generate the autocompletion script for zsh\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -h, --help Help for a command\n -v, --verbose Verbose output\n\nUse \"golangci-lint completion [command] --help\" for more information about a command.\n" } ================================================ FILE: docs/data/configuration_file.json ================================================ { "formatters": "formatters:\n # Enable specific formatter.\n # Default: [] (uses standard Go formatting)\n enable:\n - gci\n - gofmt\n - gofumpt\n - goimports\n - golines\n - swaggo\n # Formatters settings.\n settings:\n # See the dedicated \"formatters.settings\" documentation section.\n option: value\n exclusions:\n # Log a warning if an exclusion path is unused.\n # Default: false\n warn-unused: true\n # Mode of the generated files analysis.\n #\n # - `strict`: sources are excluded by strictly following the Go generated file convention.\n # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\\.$`\n # This line must appear before the first non-comment, non-blank text in the file.\n # https://go.dev/s/generatedcode\n # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc.\n # - `disable`: disable the generated files exclusion.\n #\n # Default: lax\n generated: strict\n # Which file paths to exclude.\n # This option is ignored when using `--stdin` as the path is unknown.\n # Default: []\n paths:\n - \".*\\\\.my\\\\.go$\"\n - lib/bad.go\n", "issues": "issues:\n # Maximum issues count per one linter.\n # Set to 0 to disable.\n # Default: 50\n max-issues-per-linter: 0\n # Maximum count of issues with the same text.\n # Set to 0 to disable.\n # Default: 3\n max-same-issues: 0\n # Make issues output unique by line.\n # Default: true\n uniq-by-line: false\n # Show only new issues: if there are unstaged changes or untracked files,\n # only those changes are analyzed, else only changes in HEAD~ are analyzed.\n # It's a super-useful option for integration of golangci-lint into existing large codebase.\n # It's not practical to fix all existing issues at the moment of integration:\n # much better don't allow issues in new code.\n #\n # Default: false\n new: true\n # Show only new issues created after the best common ancestor (merge-base against HEAD).\n # Default: \"\"\n new-from-merge-base: main\n # Show only new issues created after git revision `REV`.\n # Default: \"\"\n new-from-rev: HEAD\n # Show only new issues created in git patch with set file path.\n # Default: \"\"\n new-from-patch: path/to/patch/file\n # Show issues in any part of update files (requires new-from-rev or new-from-patch).\n # Default: false\n whole-files: true\n # Apply the fixes detected by the linters and formatters (if it's supported by the linter).\n # Default: false\n fix: true\n", "linters": "linters:\n # Default set of linters.\n # The value can be:\n # - `standard`: https://golangci-lint.run/docs/linters/#enabled-by-default\n # - `all`: enables all linters by default.\n # - `none`: disables all linters by default.\n # - `fast`: enables only linters considered as \"fast\" (`golangci-lint help linters --json | jq '[ .[] | select(.fast==true) ] | map(.name)'`).\n # Default: standard\n default: all\n # Enable specific linter.\n enable:\n - arangolint\n - asasalint\n - asciicheck\n - bidichk\n - bodyclose\n - canonicalheader\n - containedctx\n - contextcheck\n - copyloopvar\n - cyclop\n - decorder\n - depguard\n - dogsled\n - dupl\n - dupword\n - durationcheck\n - embeddedstructfieldcheck\n - err113\n - errcheck\n - errchkjson\n - errname\n - errorlint\n - exhaustive\n - exhaustruct\n - exptostd\n - fatcontext\n - forbidigo\n - forcetypeassert\n - funcorder\n - funlen\n - ginkgolinter\n - gocheckcompilerdirectives\n - gochecknoglobals\n - gochecknoinits\n - gochecksumtype\n - gocognit\n - goconst\n - gocritic\n - gocyclo\n - godoclint\n - godot\n - godox\n - goheader\n - gomoddirectives\n - gomodguard\n - goprintffuncname\n - gosec\n - gosmopolitan\n - govet\n - grouper\n - iface\n - importas\n - inamedparam\n - ineffassign\n - interfacebloat\n - intrange\n - iotamixing\n - ireturn\n - lll\n - loggercheck\n - maintidx\n - makezero\n - mirror\n - misspell\n - mnd\n - modernize\n - musttag\n - nakedret\n - nestif\n - nilerr\n - nilnesserr\n - nilnil\n - nlreturn\n - noctx\n - noinlineerr\n - nolintlint\n - nonamedreturns\n - nosprintfhostport\n - paralleltest\n - perfsprint\n - prealloc\n - predeclared\n - promlinter\n - protogetter\n - reassign\n - recvcheck\n - revive\n - rowserrcheck\n - sloglint\n - spancheck\n - sqlclosecheck\n - staticcheck\n - tagalign\n - tagliatelle\n - testableexamples\n - testifylint\n - testpackage\n - thelper\n - tparallel\n - unconvert\n - unparam\n - unqueryvet\n - unused\n - usestdlibvars\n - usetesting\n - varnamelen\n - wastedassign\n - whitespace\n - wrapcheck\n - wsl\n - wsl_v5\n - zerologlint\n # Disable specific linters.\n disable:\n - arangolint\n - asasalint\n - asciicheck\n - bidichk\n - bodyclose\n - canonicalheader\n - containedctx\n - contextcheck\n - copyloopvar\n - cyclop\n - decorder\n - depguard\n - dogsled\n - dupl\n - dupword\n - durationcheck\n - embeddedstructfieldcheck\n - err113\n - errcheck\n - errchkjson\n - errname\n - errorlint\n - exhaustive\n - exhaustruct\n - exptostd\n - fatcontext\n - forbidigo\n - forcetypeassert\n - funcorder\n - funlen\n - ginkgolinter\n - gocheckcompilerdirectives\n - gochecknoglobals\n - gochecknoinits\n - gochecksumtype\n - gocognit\n - goconst\n - gocritic\n - gocyclo\n - godoclint\n - godot\n - godox\n - goheader\n - gomoddirectives\n - gomodguard\n - goprintffuncname\n - gosec\n - gosmopolitan\n - govet\n - grouper\n - iface\n - importas\n - inamedparam\n - ineffassign\n - interfacebloat\n - intrange\n - iotamixing\n - ireturn\n - lll\n - loggercheck\n - maintidx\n - makezero\n - mirror\n - misspell\n - mnd\n - modernize\n - musttag\n - nakedret\n - nestif\n - nilerr\n - nilnesserr\n - nilnil\n - nlreturn\n - noctx\n - noinlineerr\n - nolintlint\n - nonamedreturns\n - nosprintfhostport\n - paralleltest\n - perfsprint\n - prealloc\n - predeclared\n - promlinter\n - protogetter\n - reassign\n - recvcheck\n - revive\n - rowserrcheck\n - sloglint\n - spancheck\n - sqlclosecheck\n - staticcheck\n - tagalign\n - tagliatelle\n - testableexamples\n - testifylint\n - testpackage\n - thelper\n - tparallel\n - unconvert\n - unparam\n - unqueryvet\n - unused\n - usestdlibvars\n - usetesting\n - varnamelen\n - wastedassign\n - whitespace\n - wrapcheck\n - wsl\n - wsl_v5\n - zerologlint\n # All available settings of specific linters.\n settings:\n # See the dedicated \"linters.settings\" documentation section.\n option: value\n # Defines a set of rules to ignore issues.\n # It does not skip the analysis, and so does not ignore \"typecheck\" errors.\n exclusions:\n # Mode of the generated files analysis.\n #\n # - `strict`: sources are excluded by strictly following the Go generated file convention.\n # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\\.$`\n # This line must appear before the first non-comment, non-blank text in the file.\n # https://go.dev/s/generatedcode\n # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc.\n # - `disable`: disable the generated files exclusion.\n #\n # Default: strict\n generated: lax\n # Log a warning if an exclusion rule is unused.\n # Default: false\n warn-unused: true\n # Predefined exclusion rules.\n # Default: []\n presets:\n - comments\n - std-error-handling\n - common-false-positives\n - legacy\n # Excluding configuration per-path, per-linter, per-text and per-source.\n rules:\n # Exclude some linters from running on tests files.\n - path: _test\\.go\n linters:\n - gocyclo\n - errcheck\n - dupl\n - gosec\n # Run some linter only for test files by excluding its issues for everything else.\n - path-except: _test\\.go\n linters:\n - forbidigo\n # Exclude known linters from partially hard-vendored code,\n # which is impossible to exclude via `nolint` comments.\n # `/` will be replaced by the current OS file path separator to properly work on Windows.\n - path: internal/hmac/\n text: \"weak cryptographic primitive\"\n linters:\n - gosec\n # Exclude some `staticcheck` messages.\n - linters:\n - staticcheck\n text: \"SA9003:\"\n # Exclude `lll` issues for long lines with `go:generate`.\n - linters:\n - lll\n source: \"^//go:generate \"\n # Which file paths to exclude: they will be analyzed, but issues from them won't be reported.\n # \"/\" will be replaced by the current OS file path separator to properly work on Windows.\n # Default: []\n paths:\n - \".*\\\\.my\\\\.go$\"\n - lib/bad.go\n # Which file paths to not exclude.\n # Default: []\n paths-except:\n - \".*\\\\.my\\\\.go$\"\n - lib/bad.go\n", "output": "# Output configuration options.\noutput:\n # The formats used to render issues.\n formats:\n # Prints issues in a text format with colors, line number, and linter name.\n # This format is the default format.\n text:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.txt\n # Print linter name in the end of issue text.\n # Default: true\n print-linter-name: false\n # Print lines of code with issue.\n # Default: true\n print-issued-lines: false\n # Use colors.\n # Default: true\n colors: false\n # Prints issues in a JSON representation.\n json:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.json\n # Prints issues in columns representation separated by tabulations.\n tab:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.txt\n # Print linter name in the end of issue text.\n # Default: true\n print-linter-name: true\n # Use colors.\n # Default: true\n colors: false\n # Prints issues in an HTML page.\n # It uses the Cloudflare CDN (cdnjs) and React.\n html:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.html\n # Prints issues in the Checkstyle format.\n checkstyle:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.xml\n # Prints issues in the Code Climate format.\n code-climate:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.json\n # Prints issues in the JUnit XML format.\n junit-xml:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.xml\n # Support extra JUnit XML fields.\n # Default: false\n extended: true\n # Prints issues in the TeamCity format.\n teamcity:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.txt\n # Prints issues in the SARIF format.\n sarif:\n # Output path can be either `stdout`, `stderr` or path to the file to write to.\n # Default: stdout\n path: ./path/to/output.json\n # Add a prefix to the output file references.\n # This option is ignored when using `output.path-mode: abs` mode.\n # Default: \"\"\n path-prefix: \"\"\n # By default, the report are related to the path obtained by `run.relative-path-mode`.\n # The mode `abs` allows to show absolute file paths instead of relative file paths.\n # The option `output.path-prefix` is ignored when using `abs` mode.\n # Default: \"\"\n path-mode: \"abs\"\n # Order to use when sorting results.\n # Possible values: `file`, `linter`, and `severity`.\n #\n # If the severity values are inside the following list, they are ordered in this order:\n # 1. error\n # 2. warning\n # 3. high\n # 4. medium\n # 5. low\n # Either they are sorted alphabetically.\n #\n # Default: [\"linter\", \"file\"]\n sort-order:\n - linter\n - severity\n - file # filepath, line, and column.\n # Show statistics per linter.\n # Default: true\n show-stats: false\n", "root": "# See the dedicated \"version\" documentation section.\nversion: \"2\"\nlinters:\n # See the dedicated \"linters\" documentation section.\n option: value\nformatters:\n # See the dedicated \"formatters\" documentation section.\n option: value\nissues:\n # See the dedicated \"issues\" documentation section.\n option: value\n# Output configuration options.\noutput:\n # See the dedicated \"output\" documentation section.\n option: value\n# Options for analysis running.\nrun:\n # See the dedicated \"run\" documentation section.\n option: value\nseverity:\n # See the dedicated \"severity\" documentation section.\n option: value\n", "run": "# Options for analysis running.\nrun:\n # Timeout for total work, e.g. 30s, 5m, 5m30s.\n # If the value is lower or equal to 0, the timeout is disabled.\n # Default: 0 (disabled)\n timeout: 5m\n # The mode used to evaluate relative paths.\n # It's used by exclusions, Go plugins, and some linters.\n # The value can be:\n # - `gomod`: the paths will be relative to the directory of the `go.mod` file.\n # - `gitroot`: the paths will be relative to the git root (the parent directory of `.git`).\n # - `cfg`: the paths will be relative to the configuration file.\n # - `wd` (NOT recommended): the paths will be relative to the place where golangci-lint is run.\n # Default: cfg\n relative-path-mode: gomod\n # Exit code when at least one issue was found.\n # Default: 1\n issues-exit-code: 2\n # Include test files or not.\n # Default: true\n tests: false\n # List of build tags, all linters use it.\n # Default: []\n build-tags:\n - mytag\n # If set, we pass it to \"go list -mod={option}\". From \"go help modules\":\n # If invoked with -mod=readonly, the go command is disallowed from the implicit\n # automatic updating of go.mod described above. Instead, it fails when any changes\n # to go.mod are needed. This setting is most useful to check that go.mod does\n # not need updates, such as in a continuous integration and testing system.\n # If invoked with -mod=vendor, the go command assumes that the vendor\n # directory holds the correct copies of dependencies and ignores\n # the dependency descriptions in go.mod.\n #\n # Allowed values: readonly|vendor|mod\n # Default: \"\"\n modules-download-mode: readonly\n # Uses version control information during the loading of packages.\n # Default: false (implies `-buildvcs=false`)\n enable-build-vcs: true\n # Allow multiple parallel golangci-lint instances running.\n # If false, golangci-lint acquires file lock on start.\n # Default: false\n allow-parallel-runners: true\n # Allow multiple golangci-lint instances running, but serialize them around a lock.\n # If false, golangci-lint exits with an error if it fails to acquire file lock on start.\n # Default: false\n allow-serial-runners: true\n # Define the Go version limit.\n # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.22.\n go: '1.23'\n # Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously.\n # Default: 0 (automatically set to match Linux container CPU quota and\n # fall back to the number of logical CPUs in the machine)\n concurrency: 4\n", "severity": "severity:\n # Set the default severity for issues.\n #\n # If severity rules are defined and the issues do not match or no severity is provided to the rule\n # this will be the default severity applied.\n # Severities should match the supported severity names of the selected out format.\n # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity\n # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel\n # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message\n # - TeamCity: https://www.jetbrains.com/help/teamcity/service-messages.html#Inspection+Instance\n #\n # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...)\n #\n # Default: \"\"\n default: error\n # When a list of severity rules are provided, severity information will be added to lint issues.\n # Severity rules have the same filtering capability as exclude rules\n # except you are allowed to specify one matcher per severity rule.\n #\n # `@linter` can be used as severity value to keep the severity from linters (e.g. revive, gosec, ...)\n #\n # Only affects out formats that support setting severity information.\n #\n # Default: []\n rules:\n - linters:\n - dupl\n severity: info\n", "version": "# Defines the configuration version.\n# The only possible value is \"2\".\nversion: \"2\"\n" } ================================================ FILE: docs/data/exclusion_presets.json ================================================ { "comments": [ { "linters": [ "staticcheck" ], "text": "(ST1000|ST1020|ST1021|ST1022)" }, { "linters": [ "revive" ], "text": "exported (.+) should have comment( \\(or a comment on this block\\))? or be unexported" }, { "linters": [ "revive" ], "text": "package comment should be of the form \"(.+)...\"" }, { "linters": [ "revive" ], "text": "comment on exported (.+) should be of the form \"(.+)...\"" }, { "linters": [ "revive" ], "text": "should have a package comment" } ], "common-false-positives": [ { "linters": [ "gosec" ], "text": "G103: Use of unsafe calls should be audited" }, { "linters": [ "gosec" ], "text": "G204: Subprocess launched with variable" }, { "linters": [ "gosec" ], "text": "G304: Potential file inclusion via variable" } ], "legacy": [ { "linters": [ "govet" ], "text": "(possible misuse of unsafe.Pointer|should have signature)" }, { "linters": [ "staticcheck" ], "text": "SA4011" }, { "linters": [ "gosec" ], "text": "G104" }, { "linters": [ "gosec" ], "text": "(G301|G302|G307): Expect (directory permissions to be 0750|file permissions to be 0600) or less" } ], "std-error-handling": [ { "linters": [ "errcheck" ], "text": "(?i)Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked" } ] } ================================================ FILE: docs/data/formatters_info.json ================================================ [ { "name": "gci", "desc": "Check if code and import statements are formatted, with additional rules.", "loadMode": 8199, "originalURL": "https://github.com/daixiang0/gci", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.30.0" }, { "name": "gofmt", "desc": "Check if the code is formatted according to 'gofmt' command.", "loadMode": 8199, "originalURL": "https://pkg.go.dev/cmd/gofmt", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.0.0" }, { "name": "gofumpt", "desc": "Check if code and import statements are formatted, with additional rules.", "loadMode": 8199, "originalURL": "https://github.com/mvdan/gofumpt", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.28.0" }, { "name": "golines", "desc": "Checks if code is formatted, and fixes long lines", "loadMode": 8199, "originalURL": "https://github.com/segmentio/golines", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v2.0.0" }, { "name": "goimports", "desc": "Checks if the code and import statements are formatted according to the 'goimports' command.", "loadMode": 8199, "originalURL": "https://pkg.go.dev/golang.org/x/tools/cmd/goimports", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.20.0" }, { "name": "swaggo", "desc": "Check if swaggo comments are formatted", "loadMode": 8199, "originalURL": "https://github.com/swaggo/swag", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v2.2.0" } ] ================================================ FILE: docs/data/icons.yaml ================================================ heart-red: ================================================ FILE: docs/data/linters_info.json ================================================ [ { "name": "arangolint", "desc": "opinionated best practices for arangodb client", "loadMode": 8767, "originalURL": "https://github.com/Crocmagnon/arangolint", "internal": false, "isSlow": true, "since": "v2.2.0" }, { "name": "asasalint", "desc": "check for pass []any as any in variadic func(...any)", "loadMode": 8767, "originalURL": "https://github.com/alingse/asasalint", "internal": false, "isSlow": true, "since": "v1.47.0" }, { "name": "asciicheck", "desc": "checks that all code identifiers does not have non-ASCII symbols in the name", "loadMode": 8199, "originalURL": "https://github.com/golangci/asciicheck", "internal": false, "isSlow": false, "since": "v1.26.0" }, { "name": "bidichk", "desc": "Checks for dangerous unicode character sequences", "loadMode": 8199, "originalURL": "https://github.com/breml/bidichk", "internal": false, "isSlow": false, "since": "v1.43.0" }, { "name": "bodyclose", "desc": "checks whether HTTP response body is closed successfully", "loadMode": 8767, "originalURL": "https://github.com/timakin/bodyclose", "internal": false, "isSlow": true, "since": "v1.18.0" }, { "name": "canonicalheader", "desc": "canonicalheader checks whether net/http.Header uses canonical header", "loadMode": 8767, "originalURL": "https://github.com/lasiar/canonicalheader", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.58.0" }, { "name": "containedctx", "desc": "containedctx is a linter that detects struct contained context.Context field", "loadMode": 8767, "originalURL": "https://github.com/sivchari/containedctx", "internal": false, "isSlow": true, "since": "v1.44.0" }, { "name": "contextcheck", "desc": "check whether the function uses a non-inherited context", "loadMode": 8767, "originalURL": "https://github.com/kkHAIKE/contextcheck", "internal": false, "isSlow": true, "since": "v1.43.0" }, { "name": "copyloopvar", "desc": "a linter detects places where loop variables are copied", "loadMode": 8199, "originalURL": "https://github.com/karamaru-alpha/copyloopvar", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.57.0" }, { "name": "cyclop", "desc": "checks function and package cyclomatic complexity", "loadMode": 8199, "originalURL": "https://github.com/bkielbasa/cyclop", "internal": false, "isSlow": false, "since": "v1.37.0" }, { "name": "decorder", "desc": "check declaration order and count of types, constants, variables and functions", "loadMode": 8199, "originalURL": "https://gitlab.com/bosi/decorder", "internal": false, "isSlow": false, "since": "v1.44.0" }, { "name": "depguard", "desc": "Go linter that checks if package imports are in a list of acceptable packages", "loadMode": 8199, "originalURL": "https://github.com/OpenPeeDeeP/depguard", "internal": false, "isSlow": false, "since": "v1.4.0" }, { "name": "dogsled", "desc": "Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())", "loadMode": 8199, "originalURL": "https://github.com/alexkohler/dogsled", "internal": false, "isSlow": false, "since": "v1.19.0" }, { "name": "dupl", "desc": "Detects duplicate fragments of code.", "loadMode": 8199, "originalURL": "https://github.com/mibk/dupl", "internal": false, "isSlow": false, "since": "v1.0.0" }, { "name": "dupword", "desc": "Checks for duplicate words in the source code", "loadMode": 8199, "originalURL": "https://github.com/Abirdcfly/dupword", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.50.0" }, { "name": "durationcheck", "desc": "check for two durations multiplied together", "loadMode": 8767, "originalURL": "https://github.com/charithe/durationcheck", "internal": false, "isSlow": true, "since": "v1.37.0" }, { "name": "embeddedstructfieldcheck", "desc": "Embedded types should be at the top of the field list of a struct, and there must be an empty line separating embedded fields from regular fields.", "loadMode": 8199, "originalURL": "https://github.com/manuelarte/embeddedstructfieldcheck", "internal": false, "isSlow": false, "since": "v2.2.0" }, { "name": "errcheck", "desc": "errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases", "groups": [ "standard" ], "loadMode": 8767, "originalURL": "https://github.com/kisielk/errcheck", "internal": false, "isSlow": true, "since": "v1.0.0" }, { "name": "errchkjson", "desc": "Checks types passed to the json encoding functions. Reports unsupported types and reports occurrences where the check for the returned error can be omitted.", "loadMode": 8767, "originalURL": "https://github.com/breml/errchkjson", "internal": false, "isSlow": true, "since": "v1.44.0" }, { "name": "errname", "desc": "Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.", "loadMode": 8767, "originalURL": "https://github.com/Antonboom/errname", "internal": false, "isSlow": true, "since": "v1.42.0" }, { "name": "errorlint", "desc": "Find code that can cause problems with the error wrapping scheme introduced in Go 1.13.", "loadMode": 8767, "originalURL": "https://codeberg.org/polyfloyd/go-errorlint", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.32.0" }, { "name": "exhaustive", "desc": "check exhaustiveness of enum switch statements", "loadMode": 8767, "originalURL": "https://github.com/nishanths/exhaustive", "internal": false, "isSlow": true, "since": "v1.28.0" }, { "name": "exhaustruct", "desc": "Checks if all structure fields are initialized", "loadMode": 8767, "originalURL": "https://github.com/GaijinEntertainment/go-exhaustruct", "internal": false, "isSlow": true, "since": "v1.46.0" }, { "name": "exptostd", "desc": "Detects functions from golang.org/x/exp/ that can be replaced by std functions.", "loadMode": 8767, "originalURL": "https://github.com/ldez/exptostd", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.63.0" }, { "name": "forbidigo", "desc": "Forbids identifiers", "loadMode": 8767, "originalURL": "https://github.com/ashanbrown/forbidigo", "internal": false, "isSlow": true, "since": "v1.34.0" }, { "name": "forcetypeassert", "desc": "Find forced type assertions", "loadMode": 8767, "originalURL": "https://github.com/gostaticanalysis/forcetypeassert", "internal": false, "isSlow": true, "since": "v1.38.0" }, { "name": "funcorder", "desc": "checks the order of functions, methods, and constructors", "loadMode": 8199, "originalURL": "https://github.com/manuelarte/funcorder", "internal": false, "isSlow": false, "since": "v2.1.0" }, { "name": "fatcontext", "desc": "detects nested contexts in loops and function literals", "loadMode": 8767, "originalURL": "https://github.com/Crocmagnon/fatcontext", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.58.0" }, { "name": "funlen", "desc": "Checks for long functions.", "loadMode": 8199, "originalURL": "https://github.com/ultraware/funlen", "internal": false, "isSlow": false, "since": "v1.18.0" }, { "name": "ginkgolinter", "desc": "enforces standards of using ginkgo and gomega", "loadMode": 8767, "originalURL": "https://github.com/nunnatsa/ginkgolinter", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.51.0" }, { "name": "gocheckcompilerdirectives", "desc": "Checks that go compiler directive comments (//go:) are valid.", "loadMode": 8199, "originalURL": "https://github.com/leighmcculloch/gocheckcompilerdirectives", "internal": false, "isSlow": false, "since": "v1.51.0" }, { "name": "gochecknoglobals", "desc": "Check that no global variables exist.", "loadMode": 8767, "originalURL": "https://github.com/leighmcculloch/gochecknoglobals", "internal": false, "isSlow": true, "since": "v1.12.0" }, { "name": "gochecknoinits", "desc": "Checks that no init functions are present in Go code", "loadMode": 8199, "internal": false, "isSlow": false, "since": "v1.12.0" }, { "name": "gochecksumtype", "desc": "Run exhaustiveness checks on Go \"sum types\"", "loadMode": 8767, "originalURL": "https://github.com/alecthomas/go-check-sumtype", "internal": false, "isSlow": true, "since": "v1.55.0" }, { "name": "gocognit", "desc": "Computes and checks the cognitive complexity of functions", "loadMode": 8199, "originalURL": "https://github.com/uudashr/gocognit", "internal": false, "isSlow": false, "since": "v1.20.0" }, { "name": "goconst", "desc": "Finds repeated strings that could be replaced by a constant", "loadMode": 8767, "originalURL": "https://github.com/jgautheron/goconst", "internal": false, "isSlow": true, "since": "v1.0.0" }, { "name": "gocritic", "desc": "Provides diagnostics that check for bugs, performance and style issues.\nExtensible without recompilation through dynamic rules.\nDynamic rules are written declaratively with AST patterns, filters, report message and optional suggestion.", "loadMode": 8767, "originalURL": "https://github.com/go-critic/go-critic", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.12.0" }, { "name": "gocyclo", "desc": "Computes and checks the cyclomatic complexity of functions", "loadMode": 8199, "originalURL": "https://github.com/fzipp/gocyclo", "internal": false, "isSlow": false, "since": "v1.0.0" }, { "name": "godoclint", "desc": "Checks Golang's documentation practice (godoc)", "loadMode": 8199, "originalURL": "https://github.com/godoc-lint/godoc-lint", "internal": false, "isSlow": false, "since": "v2.5.0" }, { "name": "godot", "desc": "Check if comments end in a period", "loadMode": 8199, "originalURL": "https://github.com/tetafro/godot", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.25.0" }, { "name": "godox", "desc": "Detects usage of FIXME, TODO and other keywords inside comments", "loadMode": 8199, "originalURL": "https://github.com/matoous/godox", "internal": false, "isSlow": false, "since": "v1.19.0" }, { "name": "err113", "desc": "Check errors handling expressions", "loadMode": 8767, "originalURL": "https://github.com/Djarvur/go-err113", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.26.0" }, { "name": "goheader", "desc": "Check if file header matches to pattern", "loadMode": 8199, "originalURL": "https://github.com/denis-tingaikin/go-header", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.28.0" }, { "name": "mnd", "desc": "An analyzer to detect magic numbers.", "loadMode": 8199, "originalURL": "https://github.com/tommy-muehle/go-mnd", "internal": false, "isSlow": false, "since": "v1.22.0" }, { "name": "modernize", "desc": "A suite of analyzers that suggest simplifications to Go code, using modern language and library features.", "loadMode": 8767, "originalURL": "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize", "internal": false, "isSlow": true, "since": "v2.6.0" }, { "name": "gomoddirectives", "desc": "Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.", "loadMode": 8199, "originalURL": "https://github.com/ldez/gomoddirectives", "internal": false, "isSlow": false, "since": "v1.39.0" }, { "name": "gomodguard", "desc": "Allow and blocklist linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.", "loadMode": 8199, "originalURL": "https://github.com/ryancurrah/gomodguard", "internal": false, "isSlow": false, "since": "v1.25.0" }, { "name": "goprintffuncname", "desc": "Checks that printf-like functions are named with `f` at the end.", "loadMode": 8199, "originalURL": "https://github.com/golangci/go-printf-func-name", "internal": false, "isSlow": false, "since": "v1.23.0" }, { "name": "gosec", "desc": "Inspects source code for security problems", "loadMode": 8767, "originalURL": "https://github.com/securego/gosec", "internal": false, "isSlow": true, "since": "v1.0.0" }, { "name": "gosmopolitan", "desc": "Report certain i18n/l10n anti-patterns in your Go codebase", "loadMode": 8767, "originalURL": "https://github.com/xen0n/gosmopolitan", "internal": false, "isSlow": true, "since": "v1.53.0" }, { "name": "govet", "desc": "Vet examines Go source code and reports suspicious constructs. It is roughly the same as 'go vet' and uses its passes.", "groups": [ "standard" ], "loadMode": 8767, "originalURL": "https://pkg.go.dev/cmd/vet", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.0.0" }, { "name": "grouper", "desc": "Analyze expression groups.", "loadMode": 8199, "originalURL": "https://github.com/leonklingele/grouper", "internal": false, "isSlow": false, "since": "v1.44.0" }, { "name": "iface", "desc": "Detect the incorrect use of interfaces, helping developers avoid interface pollution.", "loadMode": 8767, "originalURL": "https://github.com/uudashr/iface", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.62.0" }, { "name": "importas", "desc": "Enforces consistent import aliases", "loadMode": 8767, "originalURL": "https://github.com/julz/importas", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.38.0" }, { "name": "inamedparam", "desc": "reports interfaces with unnamed method parameters", "loadMode": 8199, "originalURL": "https://github.com/macabu/inamedparam", "internal": false, "isSlow": false, "since": "v1.55.0" }, { "name": "ineffassign", "desc": "detects when assignments to existing variables are not used", "groups": [ "standard" ], "loadMode": 8199, "originalURL": "https://github.com/gordonklaus/ineffassign", "internal": false, "isSlow": false, "since": "v1.0.0" }, { "name": "interfacebloat", "desc": "A linter that checks the number of methods inside an interface.", "loadMode": 8199, "originalURL": "https://github.com/sashamelentyev/interfacebloat", "internal": false, "isSlow": false, "since": "v1.49.0" }, { "name": "intrange", "desc": "intrange is a linter to find places where for loops could make use of an integer range.", "loadMode": 8199, "originalURL": "https://github.com/ckaznocha/intrange", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.57.0" }, { "name": "iotamixing", "desc": "checks if iotas are being used in const blocks with other non-iota declarations.", "loadMode": 8199, "originalURL": "https://github.com/AdminBenni/iota-mixing", "internal": false, "isSlow": false, "since": "v2.5.0" }, { "name": "ireturn", "desc": "Accept Interfaces, Return Concrete Types", "loadMode": 8767, "originalURL": "https://github.com/butuzov/ireturn", "internal": false, "isSlow": true, "since": "v1.43.0" }, { "name": "lll", "desc": "Reports long lines", "loadMode": 8199, "internal": false, "isSlow": false, "since": "v1.8.0" }, { "name": "loggercheck", "desc": "Checks key value pairs for common logger libraries (kitlog,klog,logr,slog,zap).", "loadMode": 8767, "originalURL": "https://github.com/timonwong/loggercheck", "internal": false, "isSlow": true, "since": "v1.49.0" }, { "name": "maintidx", "desc": "maintidx measures the maintainability index of each function.", "loadMode": 8199, "originalURL": "https://github.com/yagipy/maintidx", "internal": false, "isSlow": false, "since": "v1.44.0" }, { "name": "makezero", "desc": "Find slice declarations with non-zero initial length", "loadMode": 8767, "originalURL": "https://github.com/ashanbrown/makezero", "internal": false, "isSlow": true, "since": "v1.34.0" }, { "name": "mirror", "desc": "reports wrong mirror patterns of bytes/strings usage", "loadMode": 8767, "originalURL": "https://github.com/butuzov/mirror", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.53.0" }, { "name": "misspell", "desc": "Finds commonly misspelled English words", "loadMode": 8199, "originalURL": "https://github.com/golangci/misspell", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.8.0" }, { "name": "musttag", "desc": "enforce field tags in (un)marshaled structs", "loadMode": 8767, "originalURL": "https://github.com/go-simpler/musttag", "internal": false, "isSlow": true, "since": "v1.51.0" }, { "name": "nakedret", "desc": "Checks that functions with naked returns are not longer than a maximum size (can be zero).", "loadMode": 8199, "originalURL": "https://github.com/alexkohler/nakedret", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.19.0" }, { "name": "nestif", "desc": "Reports deeply nested if statements", "loadMode": 8199, "originalURL": "https://github.com/nakabonne/nestif", "internal": false, "isSlow": false, "since": "v1.25.0" }, { "name": "nilerr", "desc": "Find the code that returns nil even if it checks that the error is not nil.", "loadMode": 8767, "originalURL": "https://github.com/gostaticanalysis/nilerr", "internal": false, "isSlow": true, "since": "v1.38.0" }, { "name": "nilnesserr", "desc": "Reports constructs that checks for err != nil, but returns a different nil value error.\nPowered by nilness and nilerr.", "loadMode": 8767, "originalURL": "https://github.com/alingse/nilnesserr", "internal": false, "isSlow": true, "since": "v1.63.0" }, { "name": "nilnil", "desc": "Checks that there is no simultaneous return of `nil` error and an invalid value.", "loadMode": 8767, "originalURL": "https://github.com/Antonboom/nilnil", "internal": false, "isSlow": true, "since": "v1.43.0" }, { "name": "nlreturn", "desc": "Checks for a new line before return and branch statements to increase code clarity", "loadMode": 8199, "originalURL": "https://github.com/ssgreg/nlreturn", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.30.0" }, { "name": "noctx", "desc": "Detects function and method with missing usage of context.Context", "loadMode": 8767, "originalURL": "https://github.com/sonatard/noctx", "internal": false, "isSlow": true, "since": "v1.28.0" }, { "name": "noinlineerr", "desc": "Disallows inline error handling (`if err := ...; err != nil {`)", "loadMode": 8767, "originalURL": "https://github.com/AlwxSin/noinlineerr", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v2.2.0" }, { "name": "nonamedreturns", "desc": "Reports all named returns", "loadMode": 8767, "originalURL": "https://github.com/firefart/nonamedreturns", "internal": false, "isSlow": true, "since": "v1.46.0" }, { "name": "nosprintfhostport", "desc": "Checks for misuse of Sprintf to construct a host with port in a URL.", "loadMode": 8199, "originalURL": "https://github.com/stbenjam/no-sprintf-host-port", "internal": false, "isSlow": false, "since": "v1.46.0" }, { "name": "paralleltest", "desc": "Detects missing usage of t.Parallel() method in your Go test", "loadMode": 8767, "originalURL": "https://github.com/kunwardeep/paralleltest", "internal": false, "isSlow": true, "since": "v1.33.0" }, { "name": "perfsprint", "desc": "Checks that fmt.Sprintf can be replaced with a faster alternative.", "loadMode": 8767, "originalURL": "https://github.com/catenacyber/perfsprint", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.55.0" }, { "name": "prealloc", "desc": "Find slice declarations that could potentially be pre-allocated", "loadMode": 8767, "originalURL": "https://github.com/alexkohler/prealloc", "internal": false, "isSlow": true, "since": "v1.19.0" }, { "name": "predeclared", "desc": "find code that shadows one of Go's predeclared identifiers", "loadMode": 8199, "originalURL": "https://github.com/nishanths/predeclared", "internal": false, "isSlow": false, "since": "v1.35.0" }, { "name": "promlinter", "desc": "Check Prometheus metrics naming via promlint", "loadMode": 8199, "originalURL": "https://github.com/yeya24/promlinter", "internal": false, "isSlow": false, "since": "v1.40.0" }, { "name": "protogetter", "desc": "Reports direct reads from proto message fields when getters should be used", "loadMode": 8767, "originalURL": "https://github.com/ghostiam/protogetter", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.55.0" }, { "name": "reassign", "desc": "Checks that package variables are not reassigned", "loadMode": 8767, "originalURL": "https://github.com/curioswitch/go-reassign", "internal": false, "isSlow": true, "since": "v1.49.0" }, { "name": "recvcheck", "desc": "checks for receiver type consistency", "loadMode": 8767, "originalURL": "https://github.com/raeperd/recvcheck", "internal": false, "isSlow": true, "since": "v1.62.0" }, { "name": "revive", "desc": "Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.", "loadMode": 8199, "originalURL": "https://github.com/mgechev/revive", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.37.0" }, { "name": "rowserrcheck", "desc": "checks whether Rows.Err of rows is checked successfully", "loadMode": 8767, "originalURL": "https://github.com/jingyugao/rowserrcheck", "internal": false, "isSlow": true, "since": "v1.23.0" }, { "name": "sloglint", "desc": "ensure consistent code style when using log/slog", "loadMode": 8767, "originalURL": "https://github.com/go-simpler/sloglint", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.55.0" }, { "name": "sqlclosecheck", "desc": "Checks that sql.Rows, sql.Stmt, sqlx.NamedStmt, pgx.Query are closed.", "loadMode": 8767, "originalURL": "https://github.com/ryanrolds/sqlclosecheck", "internal": false, "isSlow": true, "since": "v1.28.0" }, { "name": "spancheck", "desc": "Checks for mistakes with OpenTelemetry/Census spans.", "loadMode": 8767, "originalURL": "https://github.com/jjti/go-spancheck", "internal": false, "isSlow": true, "since": "v1.56.0" }, { "name": "staticcheck", "desc": "It's the set of rules from staticcheck.", "groups": [ "standard" ], "loadMode": 8767, "originalURL": "https://github.com/dominikh/go-tools", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.0.0" }, { "name": "tagalign", "desc": "check that struct tags are well aligned", "loadMode": 8199, "originalURL": "https://github.com/4meepo/tagalign", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.53.0" }, { "name": "tagliatelle", "desc": "Checks the struct tags.", "loadMode": 8767, "originalURL": "https://github.com/ldez/tagliatelle", "internal": false, "isSlow": true, "since": "v1.40.0" }, { "name": "testableexamples", "desc": "linter checks if examples are testable (have an expected output)", "loadMode": 8199, "originalURL": "https://github.com/maratori/testableexamples", "internal": false, "isSlow": false, "since": "v1.50.0" }, { "name": "testifylint", "desc": "Checks usage of github.com/stretchr/testify.", "loadMode": 8767, "originalURL": "https://github.com/Antonboom/testifylint", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.55.0" }, { "name": "testpackage", "desc": "linter that makes you use a separate _test package", "loadMode": 8199, "originalURL": "https://github.com/maratori/testpackage", "internal": false, "isSlow": false, "since": "v1.25.0" }, { "name": "thelper", "desc": "thelper detects tests helpers which do not start with the t.Helper() method.", "loadMode": 8767, "originalURL": "https://github.com/kulti/thelper", "internal": false, "isSlow": true, "since": "v1.34.0" }, { "name": "tparallel", "desc": "tparallel detects inappropriate usage of t.Parallel() method in your Go test codes.", "loadMode": 8767, "originalURL": "https://github.com/moricho/tparallel", "internal": false, "isSlow": true, "since": "v1.32.0" }, { "name": "typecheck", "desc": "Like the front-end of a Go compiler, parses and type-checks Go code", "loadMode": 8199, "internal": true, "isSlow": false, "since": "v1.3.0" }, { "name": "unconvert", "desc": "Remove unnecessary type conversions", "loadMode": 8767, "originalURL": "https://github.com/mdempsky/unconvert", "internal": false, "isSlow": true, "since": "v1.0.0" }, { "name": "unparam", "desc": "Reports unused function parameters", "loadMode": 8767, "originalURL": "https://github.com/mvdan/unparam", "internal": false, "isSlow": true, "since": "v1.9.0" }, { "name": "unqueryvet", "desc": "detects SELECT * in SQL queries and SQL builders, preventing performance issues and encouraging explicit column selection", "loadMode": 8199, "originalURL": "https://github.com/MirrexOne/unqueryvet", "internal": false, "isSlow": false, "since": "v2.5.0" }, { "name": "unused", "desc": "Checks Go code for unused constants, variables, functions and types", "groups": [ "standard" ], "loadMode": 8767, "originalURL": "https://github.com/dominikh/go-tools/tree/HEAD/unused", "internal": false, "isSlow": true, "doesChangeTypes": true, "since": "v1.20.0" }, { "name": "usestdlibvars", "desc": "A linter that detect the possibility to use variables/constants from the Go standard library.", "loadMode": 8199, "originalURL": "https://github.com/sashamelentyev/usestdlibvars", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.48.0" }, { "name": "usetesting", "desc": "Reports uses of functions with replacement inside the testing package.", "loadMode": 8767, "originalURL": "https://github.com/ldez/usetesting", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v1.63.0" }, { "name": "varnamelen", "desc": "checks that the length of a variable's name matches its scope", "loadMode": 8767, "originalURL": "https://github.com/blizzy78/varnamelen", "internal": false, "isSlow": true, "since": "v1.43.0" }, { "name": "wastedassign", "desc": "Finds wasted assignment statements", "loadMode": 8767, "originalURL": "https://github.com/sanposhiho/wastedassign", "internal": false, "isSlow": true, "since": "v1.38.0" }, { "name": "whitespace", "desc": "Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc.", "loadMode": 8199, "originalURL": "https://github.com/ultraware/whitespace", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.19.0" }, { "name": "wrapcheck", "desc": "Checks that errors returned from external packages are wrapped", "loadMode": 8767, "originalURL": "https://github.com/tomarrell/wrapcheck", "internal": false, "isSlow": true, "since": "v1.32.0" }, { "name": "wsl", "desc": "add or remove empty lines", "loadMode": 8199, "originalURL": "https://github.com/bombsimon/wsl", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.20.0", "deprecation": { "since": "v2.2.0", "message": "new major version.", "replacement": "wsl_v5" } }, { "name": "wsl_v5", "desc": "add or remove empty lines", "loadMode": 8767, "originalURL": "https://github.com/bombsimon/wsl", "internal": false, "canAutoFix": true, "isSlow": true, "since": "v2.2.0" }, { "name": "zerologlint", "desc": "Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg`", "loadMode": 8767, "originalURL": "https://github.com/ykadowak/zerologlint", "internal": false, "isSlow": true, "since": "v1.53.0" }, { "name": "nolintlint", "desc": "Reports ill-formed or insufficient nolint directives", "loadMode": 8199, "originalURL": "https://github.com/golangci/golangci-lint/tree/HEAD/pkg/golinters/nolintlint/internal", "internal": false, "canAutoFix": true, "isSlow": false, "since": "v1.26.0" } ] ================================================ FILE: docs/data/thanks.json ================================================ [ { "name": "4meepo", "linters": [ "tagalign" ], "profile": "https://github.com/sponsors/4meepo", "avatar": "https://github.com/4meepo.png" }, { "name": "Abirdcfly", "linters": [ "dupword" ], "profile": "https://github.com/sponsors/Abirdcfly", "avatar": "https://github.com/Abirdcfly.png" }, { "name": "AdminBenni", "linters": [ "iotamixing" ], "profile": "https://github.com/sponsors/AdminBenni", "avatar": "https://github.com/AdminBenni.png" }, { "name": "alecthomas", "linters": [ "gochecksumtype" ], "profile": "https://github.com/sponsors/alecthomas", "avatar": "https://github.com/alecthomas.png" }, { "name": "alexkohler", "linters": [ "dogsled", "nakedret", "prealloc" ], "profile": "https://github.com/sponsors/alexkohler", "avatar": "https://github.com/alexkohler.png" }, { "name": "alingse", "linters": [ "asasalint", "nilnesserr" ], "profile": "https://github.com/sponsors/alingse", "avatar": "https://github.com/alingse.png" }, { "name": "AlwxSin", "linters": [ "noinlineerr" ], "profile": "https://github.com/sponsors/AlwxSin", "avatar": "https://github.com/AlwxSin.png" }, { "name": "Antonboom", "linters": [ "errname", "nilnil", "testifylint" ], "profile": "https://github.com/sponsors/Antonboom", "avatar": "https://github.com/Antonboom.png" }, { "name": "ashanbrown", "linters": [ "forbidigo", "makezero" ], "profile": "https://github.com/sponsors/ashanbrown", "avatar": "https://github.com/ashanbrown.png" }, { "name": "babakks", "linters": [ "godoclint" ], "profile": "https://github.com/sponsors/babakks", "avatar": "https://github.com/babakks.png" }, { "name": "bkielbasa", "linters": [ "cyclop" ], "profile": "https://github.com/sponsors/bkielbasa", "avatar": "https://github.com/bkielbasa.png" }, { "name": "blizzy78", "linters": [ "varnamelen" ], "profile": "https://github.com/sponsors/blizzy78", "avatar": "https://github.com/blizzy78.png" }, { "name": "bombsimon", "linters": [ "wsl", "wsl_v5" ], "profile": "https://github.com/sponsors/bombsimon", "avatar": "https://github.com/bombsimon.png" }, { "name": "bosi", "linters": [ "decorder" ], "profile": "https://gitlab.com/bosi", "avatar": "https://github.com/bosix.png" }, { "name": "breml", "linters": [ "bidichk", "errchkjson" ], "profile": "https://github.com/sponsors/breml", "avatar": "https://github.com/breml.png" }, { "name": "butuzov", "linters": [ "ireturn", "mirror" ], "profile": "https://github.com/sponsors/butuzov", "avatar": "https://github.com/butuzov.png" }, { "name": "catenacyber", "linters": [ "perfsprint" ], "profile": "https://github.com/sponsors/catenacyber", "avatar": "https://github.com/catenacyber.png" }, { "name": "charithe", "linters": [ "durationcheck" ], "profile": "https://github.com/sponsors/charithe", "avatar": "https://github.com/charithe.png" }, { "name": "chokoswitch", "linters": [ "reassign" ], "profile": "https://github.com/sponsors/chokoswitch", "avatar": "https://github.com/chokoswitch.png" }, { "name": "ckaznocha", "linters": [ "intrange" ], "profile": "https://github.com/sponsors/ckaznocha", "avatar": "https://github.com/ckaznocha.png" }, { "name": "client9", "linters": [ "misspell" ], "profile": "https://github.com/sponsors/client9", "avatar": "https://github.com/client9.png" }, { "name": "Crocmagnon", "linters": [ "arangolint", "fatcontext" ], "profile": "https://github.com/sponsors/Crocmagnon", "avatar": "https://github.com/Crocmagnon.png" }, { "name": "daixiang0", "linters": [ "gci" ], "profile": "https://github.com/sponsors/daixiang0", "avatar": "https://github.com/daixiang0.png" }, { "name": "denis-tingaikin", "linters": [ "goheader" ], "profile": "https://github.com/sponsors/denis-tingaikin", "avatar": "https://github.com/denis-tingaikin.png" }, { "name": "dixonwille", "linters": [ "depguard" ], "profile": "https://github.com/sponsors/dixonwille", "avatar": "https://github.com/dixonwille.png" }, { "name": "Djarvur", "linters": [ "err113" ], "profile": "https://github.com/sponsors/Djarvur", "avatar": "https://github.com/Djarvur.png" }, { "name": "dominikh", "linters": [ "staticcheck", "unused" ], "profile": "https://github.com/sponsors/dominikh", "avatar": "https://github.com/dominikh.png" }, { "name": "firefart", "linters": [ "nonamedreturns" ], "profile": "https://github.com/sponsors/firefart", "avatar": "https://github.com/firefart.png" }, { "name": "fzipp", "linters": [ "gocyclo" ], "profile": "https://github.com/sponsors/fzipp", "avatar": "https://github.com/fzipp.png" }, { "name": "ghostiam", "linters": [ "protogetter" ], "profile": "https://github.com/sponsors/ghostiam", "avatar": "https://github.com/ghostiam.png" }, { "name": "go-critic", "linters": [ "gocritic" ], "profile": "https://github.com/sponsors/go-critic", "avatar": "https://github.com/go-critic.png" }, { "name": "golang", "linters": [ "gofmt", "goimports", "modernize", "govet" ], "profile": "https://github.com/sponsors/golang", "avatar": "https://github.com/golang.png" }, { "name": "gordonklaus", "linters": [ "ineffassign" ], "profile": "https://github.com/sponsors/gordonklaus", "avatar": "https://github.com/gordonklaus.png" }, { "name": "jgautheron", "linters": [ "goconst" ], "profile": "https://github.com/sponsors/jgautheron", "avatar": "https://github.com/jgautheron.png" }, { "name": "jingyugao", "linters": [ "rowserrcheck" ], "profile": "https://github.com/sponsors/jingyugao", "avatar": "https://github.com/jingyugao.png" }, { "name": "jirfag", "linters": [ "goprintffuncname" ], "profile": "https://github.com/sponsors/jirfag", "avatar": "https://github.com/jirfag.png" }, { "name": "jjti", "linters": [ "spancheck" ], "profile": "https://github.com/sponsors/jjti", "avatar": "https://github.com/jjti.png" }, { "name": "julz", "linters": [ "importas" ], "profile": "https://github.com/sponsors/julz", "avatar": "https://github.com/julz.png" }, { "name": "karamaru-alpha", "linters": [ "copyloopvar" ], "profile": "https://github.com/sponsors/karamaru-alpha", "avatar": "https://github.com/karamaru-alpha.png" }, { "name": "kisielk", "linters": [ "errcheck" ], "profile": "https://github.com/sponsors/kisielk", "avatar": "https://github.com/kisielk.png" }, { "name": "kkHAIKE", "linters": [ "contextcheck" ], "profile": "https://github.com/sponsors/kkHAIKE", "avatar": "https://github.com/kkHAIKE.png" }, { "name": "kulti", "linters": [ "thelper" ], "profile": "https://github.com/sponsors/kulti", "avatar": "https://github.com/kulti.png" }, { "name": "kunwardeep", "linters": [ "paralleltest" ], "profile": "https://github.com/sponsors/kunwardeep", "avatar": "https://github.com/kunwardeep.png" }, { "name": "lasiar", "linters": [ "canonicalheader" ], "profile": "https://github.com/sponsors/lasiar", "avatar": "https://github.com/lasiar.png" }, { "name": "ldez", "linters": [ "exptostd", "gomoddirectives", "tagliatelle", "usetesting" ], "profile": "https://github.com/sponsors/ldez", "avatar": "https://github.com/ldez.png" }, { "name": "leighmcculloch", "linters": [ "gocheckcompilerdirectives", "gochecknoglobals" ], "profile": "https://github.com/sponsors/leighmcculloch", "avatar": "https://github.com/leighmcculloch.png" }, { "name": "leonklingele", "linters": [ "grouper" ], "profile": "https://github.com/sponsors/leonklingele", "avatar": "https://github.com/leonklingele.png" }, { "name": "macabu", "linters": [ "inamedparam" ], "profile": "https://github.com/sponsors/macabu", "avatar": "https://github.com/macabu.png" }, { "name": "manuelarte", "linters": [ "embeddedstructfieldcheck", "funcorder" ], "profile": "https://github.com/sponsors/manuelarte", "avatar": "https://github.com/manuelarte.png" }, { "name": "maratori", "linters": [ "testableexamples", "testpackage" ], "profile": "https://github.com/sponsors/maratori", "avatar": "https://github.com/maratori.png" }, { "name": "matoous", "linters": [ "godox" ], "profile": "https://github.com/sponsors/matoous", "avatar": "https://github.com/matoous.png" }, { "name": "mdempsky", "linters": [ "unconvert" ], "profile": "https://github.com/sponsors/mdempsky", "avatar": "https://github.com/mdempsky.png" }, { "name": "mgechev", "linters": [ "revive" ], "profile": "https://github.com/sponsors/mgechev", "avatar": "https://github.com/mgechev.png" }, { "name": "mibk", "linters": [ "dupl" ], "profile": "https://github.com/sponsors/mibk", "avatar": "https://github.com/mibk.png" }, { "name": "MirrexOne", "linters": [ "unqueryvet" ], "profile": "https://github.com/sponsors/MirrexOne", "avatar": "https://github.com/MirrexOne.png" }, { "name": "moricho", "linters": [ "tparallel" ], "profile": "https://github.com/sponsors/moricho", "avatar": "https://github.com/moricho.png" }, { "name": "mvdan", "linters": [ "gofumpt", "unparam" ], "profile": "https://github.com/sponsors/mvdan", "avatar": "https://github.com/mvdan.png" }, { "name": "nakabonne", "linters": [ "nestif" ], "profile": "https://github.com/sponsors/nakabonne", "avatar": "https://github.com/nakabonne.png" }, { "name": "nishanths", "linters": [ "exhaustive", "predeclared" ], "profile": "https://github.com/sponsors/nishanths", "avatar": "https://github.com/nishanths.png" }, { "name": "nunnatsa", "linters": [ "ginkgolinter" ], "profile": "https://github.com/sponsors/nunnatsa", "avatar": "https://github.com/nunnatsa.png" }, { "name": "polyfloyd", "linters": [ "errorlint" ], "profile": "https://codeberg.org/polyfloyd", "avatar": "https://codeberg.org/polyfloyd.png" }, { "name": "raeperd", "linters": [ "recvcheck" ], "profile": "https://github.com/sponsors/raeperd", "avatar": "https://github.com/raeperd.png" }, { "name": "ryancurrah", "linters": [ "gomodguard" ], "profile": "https://github.com/sponsors/ryancurrah", "avatar": "https://github.com/ryancurrah.png" }, { "name": "ryanrolds", "linters": [ "sqlclosecheck" ], "profile": "https://github.com/sponsors/ryanrolds", "avatar": "https://github.com/ryanrolds.png" }, { "name": "sanposhiho", "linters": [ "wastedassign" ], "profile": "https://github.com/sponsors/sanposhiho", "avatar": "https://github.com/sanposhiho.png" }, { "name": "sashamelentyev", "linters": [ "interfacebloat", "usestdlibvars" ], "profile": "https://github.com/sponsors/sashamelentyev", "avatar": "https://github.com/sashamelentyev.png" }, { "name": "securego", "linters": [ "gosec" ], "profile": "https://github.com/sponsors/securego", "avatar": "https://github.com/securego.png" }, { "name": "segmentio", "linters": [ "golines" ], "profile": "https://github.com/sponsors/segmentio", "avatar": "https://github.com/segmentio.png" }, { "name": "sivchari", "linters": [ "containedctx" ], "profile": "https://github.com/sponsors/sivchari", "avatar": "https://github.com/sivchari.png" }, { "name": "sonatard", "linters": [ "noctx" ], "profile": "https://github.com/sponsors/sonatard", "avatar": "https://github.com/sonatard.png" }, { "name": "ssgreg", "linters": [ "nlreturn" ], "profile": "https://github.com/sponsors/ssgreg", "avatar": "https://github.com/ssgreg.png" }, { "name": "stbenjam", "linters": [ "nosprintfhostport" ], "profile": "https://github.com/sponsors/stbenjam", "avatar": "https://github.com/stbenjam.png" }, { "name": "swaggo", "linters": [ "swaggo" ], "profile": "https://github.com/sponsors/swaggo", "avatar": "https://github.com/swaggo.png" }, { "name": "tenntenn", "linters": [ "forcetypeassert", "nilerr" ], "profile": "https://github.com/sponsors/tenntenn", "avatar": "https://github.com/tenntenn.png" }, { "name": "tetafro", "linters": [ "godot" ], "profile": "https://github.com/sponsors/tetafro", "avatar": "https://github.com/tetafro.png" }, { "name": "timakin", "linters": [ "bodyclose" ], "profile": "https://github.com/sponsors/timakin", "avatar": "https://github.com/timakin.png" }, { "name": "timonwong", "linters": [ "loggercheck" ], "profile": "https://github.com/sponsors/timonwong", "avatar": "https://github.com/timonwong.png" }, { "name": "tmzane", "linters": [ "musttag", "sloglint" ], "profile": "https://github.com/sponsors/tmzane", "avatar": "https://github.com/tmzane.png" }, { "name": "tomarrell", "linters": [ "wrapcheck" ], "profile": "https://github.com/sponsors/tomarrell", "avatar": "https://github.com/tomarrell.png" }, { "name": "tommy-muehle", "linters": [ "mnd" ], "profile": "https://github.com/sponsors/tommy-muehle", "avatar": "https://github.com/tommy-muehle.png" }, { "name": "ultraware", "linters": [ "funlen", "whitespace" ], "profile": "https://github.com/sponsors/ultraware", "avatar": "https://github.com/ultraware.png" }, { "name": "uudashr", "linters": [ "gocognit", "iface" ], "profile": "https://github.com/sponsors/uudashr", "avatar": "https://github.com/uudashr.png" }, { "name": "xen0n", "linters": [ "gosmopolitan" ], "profile": "https://github.com/sponsors/xen0n", "avatar": "https://github.com/xen0n.png" }, { "name": "xobotyi", "linters": [ "exhaustruct" ], "profile": "https://github.com/sponsors/xobotyi", "avatar": "https://github.com/xobotyi.png" }, { "name": "yagipy", "linters": [ "maintidx" ], "profile": "https://github.com/sponsors/yagipy", "avatar": "https://github.com/yagipy.png" }, { "name": "yeya24", "linters": [ "promlinter" ], "profile": "https://github.com/sponsors/yeya24", "avatar": "https://github.com/yeya24.png" }, { "name": "ykadowak", "linters": [ "zerologlint" ], "profile": "https://github.com/sponsors/ykadowak", "avatar": "https://github.com/ykadowak.png" } ] ================================================ FILE: docs/go.mod ================================================ module github.com/golangci/docs go 1.24.0 require github.com/imfing/hextra v0.11.0 // indirect ================================================ FILE: docs/go.sum ================================================ github.com/imfing/hextra v0.11.0 h1:2HswtfKD/TFg2VWp0hvsH5F3/WoEugiz8s3n2JFouqY= github.com/imfing/hextra v0.11.0/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= ================================================ FILE: docs/golangci-lint.tape ================================================ Output docs/static/images/demo.gif # NOTE: it should be run at the root of the repository. # vhs docs/golangci-lint.tape Require golangci-lint Set Shell zsh Set Theme Dracula Set FontSize 25 Set Width 2000 Set Height 900 Set WindowBar Colorful Set WindowBarSize 50 Set Padding 20 Set MarginFill "#17afc2" Set Margin 20 Set BorderRadius 30 Type "golangci-lint run" Sleep 500ms Enter Sleep 2s Sleep 1s # VHS documentation # https://github.com/charmbracelet/vhs # # Output: # Output .gif Create a GIF output at the given # Output .mp4 Create an MP4 output at the given # Output .webm Create a WebM output at the given # # Require: # Require Ensure a program is on the $PATH to proceed # # Settings: # Set FontSize Set the font size of the terminal # Set FontFamily Set the font family of the terminal # Set Height Set the height of the terminal # Set Width Set the width of the terminal # Set LetterSpacing Set the font letter spacing (tracking) # Set LineHeight Set the font line height # Set LoopOffset % Set the starting frame offset for the GIF loop # Set Theme Set the theme of the terminal # Set Padding Set the padding of the terminal # Set Framerate Set the framerate of the recording # Set PlaybackSpeed Set the playback speed of the recording # Set MarginFill Set the file or color the margin will be filled with. # Set Margin Set the size of the margin. Has no effect if MarginFill isn't set. # Set BorderRadius Set terminal border radius, in pixels. # Set WindowBar Set window bar type. (one of: Rings, RingsRight, Colorful, ColorfulRight) # Set WindowBarSize Set window bar size, in pixels. Default is 40. # Set TypingSpeed