func (v *validator) checkValidValues(cons Value) error {
	for attrTag, attrValue := range cons.attributesWithValues() {
		k := reflect.TypeOf(attrValue).Kind()
		if k == reflect.Slice || k == reflect.Array {
			// For slices we check that all values are valid.
			val := reflect.ValueOf(attrValue)
			for i := 0; i < val.Len(); i++ {
				if err := v.checkInVocab(attrTag, val.Index(i).Interface()); err != nil {
					return err
				}
			}
		} else {
			if err := v.checkInVocab(attrTag, attrValue); err != nil {
				return err
			}
		}
	}
	return nil
}
// checkValidValues returns an error if the constraints value contains an
// attribute value which is not allowed by the vocab which may have been
// registered for it.
checkValidValues returns an error if the constraints value contains an
attribute value which is not allowed by the vocab which may have been
registered for it.
// checkValidValues returns an error if the constraints value contains an // attribute value which is not allowed by the vocab which may have been // registered for it .
func (v *validator) checkValidValues(cons Value) error {
	for attrTag, attrValue := range cons.attributesWithValues() {
		k := reflect.TypeOf(attrValue).Kind()
		if k == reflect.Slice || k == reflect.Array {
			val := reflect.ValueOf(attrValue)
			for i := 0; i < val.Len(); i++ {
				if err := v.checkInVocab(attrTag, val.Index(i).Interface()); err != nil {
					return err
				}
			}
		} else {
			if err := v.checkInVocab(attrTag, attrValue); err != nil {
				return err
			}
		}
	}
	return nil
}
func ( v * validator ) checkValidValues ( cons Value ) error { for attrTag , attrValue := range cons . attributesWithValues ( ) { k := reflect . TypeOf ( attrValue ) . Kind ( ) if k == reflect . Slice || k == reflect . Array { val := reflect . ValueOf ( attrValue ) for i := 0 ; i < val . Len ( ) ; i ++ { if err := v . checkInVocab ( attrTag , val . Index ( i ) . Interface ( ) ) ; err != nil { return err } } } else { if err := v . checkInVocab ( attrTag , attrValue ) ; err != nil { return err } } } return nil }
checkValidValues returns an error if the constraints value contains an
attribute value which is not allowed by the vocab which may have been
registered for it.
checkValidValues returns an error if the constraints value contains an attribute value which is not allowed by the vocab which may have been registered for it .
// For slices we check that all values are valid.