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