Skip to content

Commit 40e17f2

Browse files
committedOct 12, 2021
fix(rule): update search condition
1 parent 898ffc4 commit 40e17f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎rule/enum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (r *TypeEnumRule) Apply(arg interface{}, flags map[string]interface{}) erro
8686

8787
func search(arr []string, toFind string) bool {
8888
ind := sort.Search(len(arr), func(i int) bool {
89-
return toFind <= arr[i]
89+
return arr[i] >= toFind
9090
})
9191
return ind < len(arr) && arr[ind] == toFind
9292
}

0 commit comments

Comments
 (0)