Go joi port - validation package
go get github.com/geek/goi
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
}