/goi

Go joi port - validation package

Primary LanguageGoMozilla Public License 2.0MPL-2.0

goi

Go joi port - validation package

Status Go Version

Install

go get github.com/geek/goi

Usage Example

s := goi.String("myField").Required().Valid("foo", "bar")
if err := s.Validate(str); err != nil {
    return err
}

n := goi.Number[float64]("test").Invalid(1.1, 1.2).Min(.5).Max(3.0)
if err := n.Validate(num); err != nil {
    return err
}

API

API