@@ -29,7 +29,6 @@ linters:
2929 - bodyclose # checks whether HTTP response body is closed successfully
3030 - contextcheck # check the function whether use a non-inherited context
3131 - decorder # check declaration order and count of types, constants, variables and functions
32- - depguard # Go linter that checks if package imports are in a list of acceptable packages
3332 - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
3433 - dupl # Tool for code clone detection
3534 - durationcheck # check for two durations multiplied together
@@ -63,7 +62,6 @@ linters:
6362 - importas # Enforces consistent import aliases
6463 - ineffassign # Detects when assignments to existing variables are not used
6564 - misspell # Finds commonly misspelled English words in comments
66- - nakedret # Finds naked returns in functions greater than a specified function length
6765 - nilerr # Finds the code that returns nil even if it checks that the error is not nil.
6866 - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
6967 - noctx # noctx finds sending http request without context.Context
@@ -81,6 +79,7 @@ linters:
8179 - wastedassign # wastedassign finds wasted assignment statements
8280 - whitespace # Tool for detection of leading and trailing whitespace
8381 disable :
82+ - depguard # Go linter that checks if package imports are in a list of acceptable packages
8483 - containedctx # containedctx is a linter that detects struct contained context.Context field
8584 - cyclop # checks function and package cyclomatic complexity
8685 - exhaustivestruct # Checks if all struct's fields are initialized
@@ -94,6 +93,7 @@ linters:
9493 - maintidx # maintidx measures the maintainability index of each function.
9594 - makezero # Finds slice declarations with non-zero initial length
9695 - maligned # Tool to detect Go structs that would take less memory if their fields were sorted
96+ - nakedret # Finds naked returns in functions greater than a specified function length
9797 - nestif # Reports deeply nested if statements
9898 - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
9999 - nolintlint # Reports ill-formed or insufficient nolint directives
@@ -111,22 +111,11 @@ linters:
111111issues :
112112 exclude-use-default : false
113113 exclude-rules :
114- # Allow complex tests, better to be self contained
115- - path : _test\.go
114+ # Allow complex tests and examples , better to be self contained
115+ - path : (examples|main\.go| _test\.go)
116116 linters :
117- - gocognit
118117 - forbidigo
119-
120- # Allow complex main function in examples
121- - path : examples
122- text : " of func `main` is high"
123- linters :
124118 - gocognit
125-
126- # Allow forbidden identifiers in examples
127- - path : examples
128- linters :
129- - forbidigo
130119
131120 # Allow forbidden identifiers in CLI commands
132121 - path : cmd
0 commit comments