diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/validation.go b/validation.go index 56fea3f..d995b3c 100644 --- a/validation.go +++ b/validation.go @@ -94,7 +94,7 @@ func ValidateStruct(input any, rulesMap RulesMap, locale ...string) Result { } v := reflect.ValueOf(input) - if v.Kind() != reflect.Struct || (v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct) { + if v.Kind() != reflect.Struct && !(v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct) { panic("validation.ValidateStruct only support struct or a pointer to a struct as first parameter") }