Apply go modernize (#650)

This commit is contained in:
philipch07
2025-09-14 21:55:37 -04:00
committed by GitHub
parent 6047a32ea0
commit c0721738c4
15 changed files with 50 additions and 59 deletions

View File

@@ -3,6 +3,7 @@ package prop
import (
"fmt"
"math"
"slices"
"strings"
)
@@ -53,10 +54,8 @@ type IntOneOf []int
// Compare implements IntConstraint.
func (i IntOneOf) Compare(a int) (float64, bool) {
for _, ii := range i {
if ii == a {
return 0.0, true
}
if slices.Contains(i, a) {
return 0.0, true
}
return 1.0, false
}