func (v *validator) UpdateVocabulary(attributeName string, allowedValues interface{}) {
	attributeName = resolveAlias(attributeName)
	// If this attribute is not registered, delegate to RegisterVocabulary()
	currentValues, ok := v.vocab[attributeName]
	if !ok {
		v.RegisterVocabulary(attributeName, allowedValues)
	}

	unique := map[interface{}]bool{}
	writeUnique := func(all []interface{}) {
		for _, one := range all {
			unique[one] = true
		}
	}

	// merge existing values with new, ensuring uniqueness
	writeUnique(currentValues)
	newValues := convertToSlice(allowedValues)
	writeUnique(newValues)

	v.updateVocabularyFromMap(attributeName, unique)
}
// UpdateVocabulary is defined on Validator.
UpdateVocabulary is defined on Validator.
// UpdateVocabulary is defined on Validator .
func (v *validator) UpdateVocabulary(attributeName string, allowedValues interface{}) {
	attributeName = resolveAlias(attributeName)
	currentValues, ok := v.vocab[attributeName]
	if !ok {
		v.RegisterVocabulary(attributeName, allowedValues)
	}
	unique := map[interface{}]bool{}
	writeUnique := func(all []interface{}) {
		for _, one := range all {
			unique[one] = true
		}
	}
	writeUnique(currentValues)
	newValues := convertToSlice(allowedValues)
	writeUnique(newValues)
	v.updateVocabularyFromMap(attributeName, unique)
}
func ( v * validator ) UpdateVocabulary ( attributeName string , allowedValues interface { } ) { attributeName = resolveAlias ( attributeName ) currentValues , ok := v . vocab [ attributeName ] if ! ok { v . RegisterVocabulary ( attributeName , allowedValues ) } unique := map [ interface { } ] bool { } writeUnique := func ( all [ ] interface { } ) { for _ , one := range all { unique [ one ] = true } } writeUnique ( currentValues ) newValues := convertToSlice ( allowedValues ) writeUnique ( newValues ) v . updateVocabularyFromMap ( attributeName , unique ) }
UpdateVocabulary is defined on Validator.
UpdateVocabulary is defined on Validator .
// If this attribute is not registered, delegate to RegisterVocabulary() // merge existing values with new, ensuring uniqueness