Skip to content

Commit

Permalink
add AnyString back, but deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
tigh-latte committed Feb 15, 2024
1 parent 24f6987 commit 8ed7477
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,10 @@ func Any[T comparable](val T, vv ...T) ValidationFunc {
return errors.New("value not found in allowed values")
}
}

// AnyString will check if the provided string is in a set of allowed values.
//
// Deprecated: use Any instead. Will be removed in a future release.
func AnyString(val string, vv ...string) ValidationFunc {
return Any(val, vv...)
}

0 comments on commit 8ed7477

Please sign in to comment.