refactor validation
This commit is contained in:
parent
4b2802a6ba
commit
be6e6eb96a
4 changed files with 7 additions and 7 deletions
|
@ -57,7 +57,7 @@ func ValidateMaxLen(value string, maxLen int, name string) []string {
|
|||
return []string{}
|
||||
}
|
||||
|
||||
func ValidateOneOf(value any, allowed []any) []string {
|
||||
func ValidateOneOf(value any, allowed []any, name string) []string {
|
||||
for _, allowedElem := range allowed {
|
||||
if value == allowedElem {
|
||||
return []string{}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue