-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
- I have looked at the documentation here first?
- I have looked at the examples provided that may showcase my question here?
Package version eg. v9, v10: v10
Issue, Question or Enhancement: Issue
I found there is an bad case with lt=float
Code sample, to showcase or reproduce:
package main
import (
"fmt"
"github.com/go-playground/validator/v10"
)
type Data struct {
A float32
}
var validate = validator.New()
func main() {
data1 := Data{
A: 0.9,
}
data1 := Data{
A: 0.1,
}
rules := map[string]string{
"A": "gt=0.1,lt=0.9",
}
validate.RegisterStructValidationMapRules(rules, Data{})
err := validate.Struct(data1)
err := validate.Struct(data2)
fmt.Println(err)
fmt.Println()
}Metadata
Metadata
Assignees
Labels
No labels