Skip to content

Commit e7ab553

Browse files
committed
Add forbidigo linter to enforce cmp.Equal usage
Configured the forbidigo linter in .golangci.yml to forbid the use of reflect.DeepEqual, recommending cmp.Equal instead. This helps ensure more reliable equality checks in the codebase.
1 parent 790f4e2 commit e7ab553

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ linters:
88
- copyloopvar
99
- dogsled
1010
- dupl
11+
- forbidigo
1112
- gocritic
1213
- godot
1314
- goheader
@@ -40,6 +41,10 @@ linters:
4041
4142
Use of this source code is governed by a BSD-style
4243
license that can be found in the LICENSE file.
44+
forbidigo:
45+
forbid:
46+
- pattern: ^reflect\.DeepEqual$
47+
msg: "Use cmp.Equal instead of reflect.DeepEqual"
4348
gosec:
4449
excludes:
4550
# duplicates errcheck

0 commit comments

Comments
 (0)