@@ -85,6 +85,7 @@ linters:
8585 - mirror
8686 - misspell
8787 - mnd
88+ - modernize
8889 - musttag
8990 - nakedret
9091 - nestif
@@ -199,6 +200,7 @@ linters:
199200 - mirror
200201 - misspell
201202 - mnd
203+ - modernize
202204 - musttag
203205 - nakedret
204206 - nestif
@@ -396,6 +398,9 @@ linters:
396398 # Default: []
397399 ignore :
398400 - " 0C0C"
401+ # Checks only comments, skip strings.
402+ # Default: false
403+ comments-only : true
399404
400405 embeddedstructfieldcheck :
401406 # Checks that there is an empty space between the embedded fields and regular fields.
@@ -809,6 +814,9 @@ linters:
809814 # Detects multiple imports of the same package under different aliases.
810815 # https://go-critic.com/overview.html#dupimport
811816 - dupImport
817+ # Detects duplicated option function arguments in variadic function calls.
818+ # https://go-critic.com/overview.html#dupoption
819+ - dupOption
812820 # Detects suspicious duplicated sub-expressions.
813821 # https://go-critic.com/overview.html#dupsubexpr
814822 - dupSubExpr
@@ -1043,6 +1051,9 @@ linters:
10431051 # Detects Yoda style expressions and suggests to replace them.
10441052 # https://go-critic.com/overview.html#yodastyleexpr
10451053 - yodaStyleExpr
1054+ # Detects bytes.Repeat with 0 value.
1055+ # https://go-critic.com/overview.html#zerobyterepeat
1056+ - zeroByteRepeat
10461057
10471058 # Enable all checks.
10481059 # Default: false
@@ -2106,6 +2117,47 @@ linters:
21062117 - ' ^math\.'
21072118 - ' ^http\.StatusText$'
21082119
2120+ modernize :
2121+ # List of analyzers to disable.
2122+ # By default, all analyzers are enabled.
2123+ disable :
2124+ # Replace interface{} with any.
2125+ - any
2126+ # Replace for-range over b.N with b.Loop.
2127+ - bloop
2128+ # Replace []byte(fmt.Sprintf) with fmt.Appendf.
2129+ - fmtappendf
2130+ # Remove redundant re-declaration of loop variables.
2131+ - forvar
2132+ # Replace explicit loops over maps with calls to maps package.
2133+ - mapsloop
2134+ # Replace if/else statements with calls to min or max.
2135+ - minmax
2136+ # Simplify code by using go1.26's new(expr).
2137+ - newexpr
2138+ # Suggest replacing omitempty with omitzero for struct fields.
2139+ - omitzero
2140+ # Replace 3-clause for loops with for-range over integers.
2141+ - rangeint
2142+ # Replace reflect.TypeOf(x) with TypeFor[T]().
2143+ - reflecttypefor
2144+ # Replace loops with slices.Contains or slices.ContainsFunc.
2145+ - slicescontains
2146+ # Replace sort.Slice with slices.Sort for basic types.
2147+ - slicessort
2148+ # Use iterators instead of Len/At-style APIs.
2149+ - stditerators
2150+ # Replace HasPrefix/TrimPrefix with CutPrefix.
2151+ - stringscutprefix
2152+ # Replace ranging over Split/Fields with SplitSeq/FieldsSeq.
2153+ - stringsseq
2154+ # Replace += with strings.Builder.
2155+ - stringsbuilder
2156+ # Replace context.WithCancel with t.Context in tests.
2157+ - testingcontext
2158+ # Replace wg.Add(1)/go/wg.Done() with wg.Go.
2159+ - waitgroup
2160+
21092161 musttag :
21102162 # A set of custom functions to check in addition to the builtin ones.
21112163 # Default: json, xml, gopkg.in/yaml.v3, BurntSushi/toml, mitchellh/mapstructure, jmoiron/sqlx
@@ -2212,6 +2264,12 @@ linters:
22122264 # Enable/disable optimization of hex formatting.
22132265 # Default: true
22142266 hex-format : false
2267+ # Enable/disable optimization of concat loop.
2268+ # Default: true
2269+ concat-loop : false
2270+ # Optimization of `concat-loop` even with other operations.
2271+ # Default: false
2272+ loop-other-ops : true
22152273
22162274 prealloc :
22172275 # IMPORTANT: we don't recommend using this linter before doing performance profiling.
0 commit comments