// ValidateName validates the name of the context
ValidateName validates the name of the context
// ValidateName validates the name of the context
func (v *Validator) ValidateName(val interface{}) error {
	name, ok := val.(string)
	if !ok {
		return errors.NewCastError(val, "string")
	}
	if len(name) < 1 {
		return v.Localizer.MustLocalizeError("context.common.validation.name.error.required")
	}
	matched, _ := regexp.Match(legalNameChars, []byte(name))
	if matched {
		return nil
	}
	return v.Localizer.MustLocalizeError("context.common.validation.name.error.invalidChars", localize.NewEntry("Name", name))
}
func ( v * Validator ) ValidateName ( val interface { } ) error { name , ok := val . ( string ) if ! ok { return errors . NewCastError ( val , " " ) } if len ( name ) < 1 { return v . Localizer . MustLocalizeError ( " " ) } matched , _ := regexp . Match ( legalNameChars , [ ] byte ( name ) ) if matched { return nil } return v . Localizer . MustLocalizeError ( " " , localize . NewEntry ( " " , name ) ) }
ValidateName validates the name of the context
ValidateName validates the name of the context