Skip to content

Commit 92d8777

Browse files
authored
docs: improve modernize reference (#6136)
1 parent 588af2f commit 92d8777

File tree

1 file changed

+38
-36
lines changed

1 file changed

+38
-36
lines changed

.golangci.next.reference.yml

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,43 +2115,45 @@ linters:
21152115
- '^http\.StatusText$'
21162116

21172117
modernize:
2118+
# List of analyzers to disable.
2119+
# By default, all analyzers are enabled.
21182120
disable:
2119-
# Replace interface{} with any.
2120-
- any
2121-
# Replace for-range over b.N with b.Loop.
2122-
- bloop
2123-
# Replace []byte(fmt.Sprintf) with fmt.Appendf.
2124-
- fmtappendf
2125-
# Remove redundant re-declaration of loop variables.
2126-
- forvar
2127-
# Replace explicit loops over maps with calls to maps package.
2128-
- mapsloop
2129-
# Replace if/else statements with calls to min or max.
2130-
- minmax
2131-
# Simplify code by using go1.26's new(expr).
2132-
- newexpr
2133-
# Suggest replacing omitempty with omitzero for struct fields.
2134-
- omitzero
2135-
# Replace 3-clause for loops with for-range over integers.
2136-
- rangeint
2137-
# Replace reflect.TypeOf(x) with TypeFor[T]().
2138-
- reflecttypefor
2139-
# Replace loops with slices.Contains or slices.ContainsFunc.
2140-
- slicescontains
2141-
# Replace sort.Slice with slices.Sort for basic types.
2142-
- slicessort
2143-
# Use iterators instead of Len/At-style APIs.
2144-
- stditerators
2145-
# Replace HasPrefix/TrimPrefix with CutPrefix.
2146-
- stringscutprefix
2147-
# Replace ranging over Split/Fields with SplitSeq/FieldsSeq.
2148-
- stringsseq
2149-
# Replace += with strings.Builder.
2150-
- stringsbuilder
2151-
# Replace context.WithCancel with t.Context in tests.
2152-
- testingcontext
2153-
# Replace wg.Add(1)/go/wg.Done() with wg.Go.
2154-
- waitgroup
2121+
# Replace interface{} with any.
2122+
- any
2123+
# Replace for-range over b.N with b.Loop.
2124+
- bloop
2125+
# Replace []byte(fmt.Sprintf) with fmt.Appendf.
2126+
- fmtappendf
2127+
# Remove redundant re-declaration of loop variables.
2128+
- forvar
2129+
# Replace explicit loops over maps with calls to maps package.
2130+
- mapsloop
2131+
# Replace if/else statements with calls to min or max.
2132+
- minmax
2133+
# Simplify code by using go1.26's new(expr).
2134+
- newexpr
2135+
# Suggest replacing omitempty with omitzero for struct fields.
2136+
- omitzero
2137+
# Replace 3-clause for loops with for-range over integers.
2138+
- rangeint
2139+
# Replace reflect.TypeOf(x) with TypeFor[T]().
2140+
- reflecttypefor
2141+
# Replace loops with slices.Contains or slices.ContainsFunc.
2142+
- slicescontains
2143+
# Replace sort.Slice with slices.Sort for basic types.
2144+
- slicessort
2145+
# Use iterators instead of Len/At-style APIs.
2146+
- stditerators
2147+
# Replace HasPrefix/TrimPrefix with CutPrefix.
2148+
- stringscutprefix
2149+
# Replace ranging over Split/Fields with SplitSeq/FieldsSeq.
2150+
- stringsseq
2151+
# Replace += with strings.Builder.
2152+
- stringsbuilder
2153+
# Replace context.WithCancel with t.Context in tests.
2154+
- testingcontext
2155+
# Replace wg.Add(1)/go/wg.Done() with wg.Go.
2156+
- waitgroup
21552157

21562158
musttag:
21572159
# A set of custom functions to check in addition to the builtin ones.

0 commit comments

Comments
 (0)