func ValidateApplicationName(name string) error {
	if IsValidApplication(name) {
		return nil
	}

	// If the application has uppercase characters, bail out and explain
	// why.
	if uppercaseChar.MatchString(name) {
		return errors.Errorf("invalid application name %q, unexpected uppercase character", name)
	}
	// If the application ends up being suffixed by a number, then we want
	// to mention it to users why.
	if tailNumberSuffix.MatchString(name) {
		return errors.Errorf("invalid application name %q, unexpected number(s) found after last hyphen", name)
	}

	index := strings.IndexFunc(name, invalidRuneForApplicationName)
	if index < 0 {
		return errors.Errorf("invalid application name %q", name)
	}

	// We have to ensure that we don't break up multi-rune characters, by
	// just selecting the index. Instead look at a slice of runes and use
	// the first one.
	invalidRune := []rune(name[index:])[0]
	return errors.Errorf("invalid application name %q, unexpected character %c", name, invalidRune)
}
// ValidateApplicationName takes a name and attempts to validate the application
// name, before returning a reason why it's not valid.
//
// This should supersede IsValidApplication. It provides a lot more granular
// information about why something might be wrong, which is a much better UX.
ValidateApplicationName takes a name and attempts to validate the application
name, before returning a reason why it's not valid.

This should supersede IsValidApplication. It provides a lot more granular
information about why something might be wrong, which is a much better UX.
// ValidateApplicationName takes a name and attempts to validate the application // name before returning a reason why it ' s not valid . // // This should supersede IsValidApplication . It provides a lot more granular // information about why something might be wrong which is a much better UX .
func ValidateApplicationName(name string) error {
	if IsValidApplication(name) {
		return nil
	}
	if uppercaseChar.MatchString(name) {
		return errors.Errorf("invalid application name %q, unexpected uppercase character", name)
	}
	if tailNumberSuffix.MatchString(name) {
		return errors.Errorf("invalid application name %q, unexpected number(s) found after last hyphen", name)
	}
	index := strings.IndexFunc(name, invalidRuneForApplicationName)
	if index < 0 {
		return errors.Errorf("invalid application name %q", name)
	}
	invalidRune := []rune(name[index:])[0]
	return errors.Errorf("invalid application name %q, unexpected character %c", name, invalidRune)
}
func ValidateApplicationName ( name string ) error { if IsValidApplication ( name ) { return nil } if uppercaseChar . MatchString ( name ) { return errors . Errorf ( " " , name ) } if tailNumberSuffix . MatchString ( name ) { return errors . Errorf ( " " , name ) } index := strings . IndexFunc ( name , invalidRuneForApplicationName ) if index < 0 { return errors . Errorf ( " " , name ) } invalidRune := [ ] rune ( name [ index : ] ) [ 0 ] return errors . Errorf ( " " , name , invalidRune ) }
ValidateApplicationName takes a name and attempts to validate the application
name, before returning a reason why it's not valid.
ValidateApplicationName takes a name and attempts to validate the application name before returning a reason why it ' s not valid .
// If the application has uppercase characters, bail out and explain // why. // If the application ends up being suffixed by a number, then we want // to mention it to users why. // We have to ensure that we don't break up multi-rune characters, by // just selecting the index. Instead look at a slice of runes and use // the first one.