You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- copyloopvar # detects places where loop variables are copied (Go 1.22+)
229
280
- cyclop # checks function and package cyclomatic complexity
281
+
- depguard # checks if package imports are in a list of acceptable packages
230
282
- dupl # tool for code clone detection
231
283
- durationcheck # checks for two durations multiplied together
232
284
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
233
285
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
234
286
- exhaustive # checks exhaustiveness of enum switch statements
287
+
- exptostd # detects functions from golang.org/x/exp/ that can be replaced by std functions
235
288
- fatcontext # detects nested contexts in loops
236
289
- forbidigo # forbids identifiers
237
290
- funlen # tool for detection of long functions
@@ -246,9 +299,9 @@ linters:
246
299
- godot # checks if comments end in a period
247
300
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
248
301
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
249
-
- gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
250
302
- goprintffuncname # checks that printf-like functions are named with f at the end
251
303
- gosec # inspects source code for security problems
304
+
- iface # checks the incorrect use of interfaces, helping developers avoid interface pollution
252
305
- intrange # finds places where for loops could make use of an integer range
253
306
- lll # reports long lines
254
307
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
@@ -259,6 +312,7 @@ linters:
259
312
- nakedret # finds naked returns in functions greater than a specified function length
260
313
- nestif # reports deeply nested if statements
261
314
- nilerr # finds the code that returns nil even if it checks that the error is not nil
315
+
- nilnesserr # reports that it checks for err != nil, but it returns a different nil value error (powered by nilness and nilerr)
262
316
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
263
317
- noctx # finds sending http request without context.Context
264
318
- nolintlint # reports ill-formed or insufficient nolint directives
@@ -269,19 +323,20 @@ linters:
269
323
- promlinter # checks Prometheus metrics naming via promlint
270
324
- protogetter # reports direct reads from proto message fields when getters should be used
271
325
- reassign # checks that package variables are not reassigned
326
+
- recvcheck # checks for receiver type consistency
272
327
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
273
328
- rowserrcheck # checks whether Err of rows is checked successfully
274
329
- sloglint # ensure consistent code style when using log/slog
275
330
- spancheck # checks for mistakes with OpenTelemetry/Census spans
276
331
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
277
332
- stylecheck # is a replacement for golint
278
-
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
279
333
- testableexamples # checks if examples are testable (have an expected output)
280
334
- testifylint # checks usage of github.com/stretchr/testify
281
335
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
282
336
- unconvert # removes unnecessary type conversions
283
337
- unparam # reports unused function parameters
284
338
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
339
+
- usetesting # reports uses of functions with replacement inside the testing package
- whitespace # detects leading and trailing whitespace
287
342
@@ -290,7 +345,7 @@ linters:
290
345
#- exhaustruct # [highly recommend to enable] checks if all structure fields are initialized
291
346
#- gci # controls golang package import order and makes it always deterministic
292
347
#- ginkgolinter # [if you use ginkgo/gomega] enforces standards of using ginkgo and gomega
293
-
#- godox # detects FIXME, TODO and other comment keywords
348
+
#- godox # detects usage of FIXME, TODO and other keywords inside comments
294
349
#- goheader # checks is file header matches to pattern
295
350
#- inamedparam # [great idea, but too strict, need to ignore a lot of cases by default] reports interfaces with unnamed method parameters
296
351
#- interfacebloat # checks the number of methods inside an interface
@@ -304,16 +359,14 @@ linters:
304
359
## disabled
305
360
#- containedctx # detects struct contained context.Context field
306
361
#- contextcheck # [too many false positives] checks the function whether use a non-inherited context
307
-
#- depguard # [replaced by gomodguard] checks if package imports are in a list of acceptable packages
308
362
#- dogsled # checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
309
363
#- dupword # [useless without config] checks for duplicate words in the source code
310
364
#- err113 # [too strict] checks the errors handling expressions
311
365
#- errchkjson # [don't see profit + I'm against of omitting errors like in the first example https://github.com/breml/errchkjson] checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted
312
-
#- execinquery # [deprecated] checks query string in Query function which reads your Go src files and warning it finds
313
-
#- exportloopref # [not necessary from Go 1.22] checks for pointers to enclosing loop variables
314
366
#- forcetypeassert # [replaced by errcheck] finds forced type assertions
315
367
#- gofmt # [replaced by goimports] checks whether code was gofmt-ed
316
368
#- gofumpt # [replaced by goimports, gofumports is not available yet] checks whether code was gofumpt-ed
369
+
#- gomodguard # [use more powerful depguard] allow and block lists linter for direct Go module dependencies
317
370
#- gosmopolitan # reports certain i18n/l10n anti-patterns in your Go codebase
318
371
#- grouper # analyzes expression groups
319
372
#- importas # enforces consistent import aliases
@@ -322,6 +375,7 @@ linters:
322
375
#- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity
323
376
#- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test
324
377
#- tagliatelle # checks the struct tags
378
+
#- tenv # [deprecated, replaced by usetesting] detects using os.Setenv instead of t.Setenv since Go1.17
325
379
#- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
326
380
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
0 commit comments