Skip to content

golangci: Enable additional linters

Patrick Steinhardt requested to merge pks-golangci-addn-linters into master

This MR enables various linters and un-silences linters which are by default disabled by golangci-lint. As a result, we now lint for the following things:

  • errcheck verifies that error codes are correctly checked
  • errorlint verifies that we correctly do Go-1.13 style error wrapping and checking
  • gci verifies that imports are always in a deterministic order
  • golint verifies that all public symbols got documentation
  • gosimple proposes simplifications
  • nolintlint verifies that //nolint annotations work as expected
  • staticcheck performs static analysis
  • structcheck finds unused struct fields
  • unused checks for unused code
  • gochecknoglobals verifies we don't have global variables

The errcheck, errorlint, golint and gochecknoglobals do produce lots of warnings for our current code. As such, they're introduced as a last step only, where we now start checking for newly introduced changes only.

Merge request reports