@@ -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
@@ -2106,6 +2108,45 @@ linters:
21062108 - ' ^math\.'
21072109 - ' ^http\.StatusText$'
21082110
2111+ modernize :
2112+ disable :
2113+ # Replace interface{} with any.
2114+ - any
2115+ # Replace for-range over b.N with b.Loop.
2116+ - bloop
2117+ # Replace []byte(fmt.Sprintf) with fmt.Appendf.
2118+ - fmtappendf
2119+ # Remove redundant re-declaration of loop variables.
2120+ - forvar
2121+ # Replace explicit loops over maps with calls to maps package.
2122+ - mapsloop
2123+ # Replace if/else statements with calls to min or max.
2124+ - minmax
2125+ # Simplify code by using go1.26's new(expr).
2126+ - newexpr
2127+ # Suggest replacing omitempty with omitzero for struct fields.
2128+ - omitzero
2129+ # Replace 3-clause for loops with for-range over integers.
2130+ - rangeint
2131+ # Replace reflect.TypeOf(x) with TypeFor[T]().
2132+ - reflecttypefor
2133+ # Replace loops with slices.Contains or slices.ContainsFunc.
2134+ - slicescontains
2135+ # Replace sort.Slice with slices.Sort for basic types.
2136+ - slicessort
2137+ # Use iterators instead of Len/At-style APIs.
2138+ - stditerators
2139+ # Replace HasPrefix/TrimPrefix with CutPrefix.
2140+ - stringscutprefix
2141+ # Replace ranging over Split/Fields with SplitSeq/FieldsSeq.
2142+ - stringsseq
2143+ # Replace += with strings.Builder.
2144+ - stringsbuilder
2145+ # Replace context.WithCancel with t.Context in tests.
2146+ - testingcontext
2147+ # Replace wg.Add(1)/go/wg.Done() with wg.Go.
2148+ - waitgroup
2149+
21092150 musttag :
21102151 # A set of custom functions to check in addition to the builtin ones.
21112152 # Default: json, xml, gopkg.in/yaml.v3, BurntSushi/toml, mitchellh/mapstructure, jmoiron/sqlx
0 commit comments