ch13.2
This commit is contained in:
@@ -42,7 +42,7 @@ func MaxChars(value string, n int) bool {
|
||||
return utf8.RuneCountInString(value) <= n
|
||||
}
|
||||
|
||||
func PermittedInt(value int, permittedValues ...int) bool {
|
||||
func PermittedValue[T comparable](value T, permittedValues ...T) bool {
|
||||
for i := range permittedValues {
|
||||
if value == permittedValues[i] {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user