// IntBetween returns a SchemaValidateFunc which tests if the provided value
// is of type int and is between min and max (inclusive)
IntBetween returns a SchemaValidateFunc which tests if the provided value
is of type int and is between min and max (inclusive)
// IntBetween returns a SchemaValidateFunc which tests if the provided value // is of type int and is between min and max ( inclusive )
func IntBetween(min, max int) schema.SchemaValidateFunc {
	return func(i interface{}, k string) (s []string, es []error) {
		v, ok := i.(int)
		if !ok {
			es = append(es, fmt.Errorf("expected type of %s to be int", k))
			return
		}
		if v < min || v > max {
			es = append(es, fmt.Errorf("expected %s to be in the range (%d - %d), got %d", k, min, max, v))
			return
		}
		return
	}
}
func IntBetween ( min , max int ) schema . SchemaValidateFunc { return func ( i interface { } , k string ) ( s [ ] string , es [ ] error ) { v , ok := i . ( int ) if ! ok { es = append ( es , fmt . Errorf ( " " , k ) ) return } if v < min || v > max { es = append ( es , fmt . Errorf ( " " , k , min , max , v ) ) return } return } }
IntBetween returns a SchemaValidateFunc which tests if the provided value
is of type int and is between min and max (inclusive)
IntBetween returns a SchemaValidateFunc which tests if the provided value is of type int and is between min and max ( inclusive )