govalid v1.2.0 Release Notes
Release Date: 2020-10-23 // almost 4 years ago-
You can add custom validation rules for string, int64, and float64.
v := govalid.New()v.AddCustomInt64Rule("even", func(field string, value int64) string { if value%2 == 0 { return "" } return fmt.Sprintf("%s must be even", field) })type Foo struct { Bar int64 `govalid:"req|even"`}