[x] I have looked at the documentation here first?
[x] I have looked at the examples provided that may showcase my question here?
Package version eg. v9, v10:
v10.20.0
Issue, Question or Enhancement:
The go-playground/validator package panics when validating struct fields with the max tag on null.Int fields. This issue did not occur in earlier versions. Previously, the package would not panic.
Code sample, to showcase or reproduce:
package main
import (
"fmt"
"github.com/go-playground/validator/v10"
"gopkg.in/guregu/null.v4"
)
type User struct {
Name string `json:"name"`
Age int `json:"age"`
NullAge null.Int `validate:"max=10"`
}
func main() {
v := validator.New()
user := User{
Name: "John Doe",
Age: 30,
NullAge: null.IntFrom(15),
}
err := v.Struct(user)
if err != nil {
fmt.Println("Validation failed:", err)
} else {
fmt.Println("Validation succeeded")
}
}
Expected behavior:
The validator should not panic when encountering the max tag on null.Int fields. Ideally, it should either validate the null.Int field properly or skip validation without causing a panic.
Actual behavior:
The validator panics when it encounters the max tag on null.Int fields.
Steps to reproduce:
1. Define a struct with a null.Int field and a max validation tag.
2. Create an instance of the struct with a value for the null.Int field.
3. Run the validator on the struct.
There might me other tags aswell which now panics with struct i have checked with min, max only
Package version eg. v9, v10:
v10.20.0
Issue, Question or Enhancement:
The go-playground/validator package panics when validating struct fields with the max tag on null.Int fields. This issue did not occur in earlier versions. Previously, the package would not panic.
Code sample, to showcase or reproduce:
Expected behavior:
The validator should not panic when encountering the max tag on null.Int fields. Ideally, it should either validate the null.Int field properly or skip validation without causing a panic.
Actual behavior:
The validator panics when it encounters the max tag on null.Int fields.
Steps to reproduce:
There might me other tags aswell which now panics with struct i have checked with min, max only