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+)
282
343
- cyclop # checks function and package cyclomatic complexity
344
+
- depguard # checks if package imports are in a list of acceptable packages
283
345
- dupl # tool for code clone detection
284
346
- durationcheck # checks for two durations multiplied together
285
347
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
286
348
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
287
349
- exhaustive # checks exhaustiveness of enum switch statements
350
+
- exptostd # detects functions from golang.org/x/exp/ that can be replaced by std functions
288
351
- fatcontext # detects nested contexts in loops
289
352
- forbidigo # forbids identifiers
290
353
- funlen # tool for detection of long functions
@@ -299,7 +362,6 @@ linters:
299
362
- godot # checks if comments end in a period
300
363
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
301
364
- gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
302
-
- 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
303
365
- goprintffuncname # checks that printf-like functions are named with f at the end
304
366
- gosec # inspects source code for security problems
305
367
- iface # checks the incorrect use of interfaces, helping developers avoid interface pollution
@@ -313,6 +375,7 @@ linters:
313
375
- nakedret # finds naked returns in functions greater than a specified function length
314
376
- nestif # reports deeply nested if statements
315
377
- nilerr # finds the code that returns nil even if it checks that the error is not nil
378
+
- nilnesserr # reports that it checks for err != nil, but it returns a different nil value error (powered by nilness and nilerr)
316
379
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
317
380
- noctx # finds sending http request without context.Context
318
381
- nolintlint # reports ill-formed or insufficient nolint directives
@@ -330,14 +393,14 @@ linters:
330
393
- spancheck # checks for mistakes with OpenTelemetry/Census spans
331
394
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
332
395
- stylecheck # is a replacement for golint
333
-
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
334
396
- testableexamples # checks if examples are testable (have an expected output)
335
397
- testifylint # checks usage of github.com/stretchr/testify
336
398
- testpackage # makes you use a separate _test package
337
399
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
338
400
- unconvert # removes unnecessary type conversions
339
401
- unparam # reports unused function parameters
340
402
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
403
+
- usetesting # reports uses of functions with replacement inside the testing package
- whitespace # detects leading and trailing whitespace
343
406
@@ -346,7 +409,7 @@ linters:
346
409
- exhaustruct # [highly recommend to enable] checks if all structure fields are initialized
347
410
- gci # controls golang package import order and makes it always deterministic
348
411
#- ginkgolinter # [if you use ginkgo/gomega] enforces standards of using ginkgo and gomega
349
-
#- godox # detects FIXME, TODO and other comment keywords
412
+
#- godox # detects usage of FIXME, TODO and other keywords inside comments
350
413
#- goheader # checks is file header matches to pattern
351
414
#- inamedparam # [great idea, but too strict, need to ignore a lot of cases by default] reports interfaces with unnamed method parameters
352
415
#- interfacebloat # checks the number of methods inside an interface
@@ -360,15 +423,14 @@ linters:
360
423
## disabled
361
424
#- containedctx # detects struct contained context.Context field
362
425
#- contextcheck # [too many false positives] checks the function whether use a non-inherited context
363
-
#- depguard # [replaced by gomodguard] checks if package imports are in a list of acceptable packages
364
426
#- dogsled # checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
365
427
#- dupword # [useless without config] checks for duplicate words in the source code
366
428
#- err113 # [too strict] checks the errors handling expressions
367
429
#- 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
368
-
#- exportloopref # [not necessary from Go 1.22] checks for pointers to enclosing loop variables
369
430
#- forcetypeassert # [replaced by errcheck] finds forced type assertions
370
431
#- gofmt # [replaced by goimports] checks whether code was gofmt-ed
371
432
#- gofumpt # [replaced by goimports, gofumports is not available yet] checks whether code was gofumpt-ed
433
+
#- gomodguard # [use more powerful depguard] allow and block lists linter for direct Go module dependencies
372
434
#- gosmopolitan # reports certain i18n/l10n anti-patterns in your Go codebase
373
435
#- grouper # analyzes expression groups
374
436
#- importas # enforces consistent import aliases
@@ -377,6 +439,7 @@ linters:
377
439
#- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity
378
440
#- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test
379
441
#- tagliatelle # checks the struct tags
442
+
#- tenv # [deprecated, replaced by usetesting] detects using os.Setenv instead of t.Setenv since Go1.17
380
443
#- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
381
444
#- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
0 commit comments