func ValidateIndexName(val string) (string, error) {
	// 'index.docker.io' => 'docker.io'
	if val == "index."+IndexName {
		val = IndexName
	}
	if strings.HasPrefix(val, "-") || strings.HasSuffix(val, "-") {
		return "", fmt.Errorf("Invalid index name (%s). Cannot begin or end with a hyphen.", val)
	}
	// *TODO: Check if valid hostname[:port]/ip[:port]?
	return val, nil
}
// ValidateIndexName validates an index name.
ValidateIndexName validates an index name.
// ValidateIndexName validates an index name .
func ValidateIndexName(val string) (string, error) {
	if val == "index."+IndexName {
		val = IndexName
	}
	if strings.HasPrefix(val, "-") || strings.HasSuffix(val, "-") {
		return "", fmt.Errorf("Invalid index name (%s). Cannot begin or end with a hyphen.", val)
	}
	return val, nil
}
func ValidateIndexName ( val string ) ( string , error ) { if val == " " + IndexName { val = IndexName } if strings . HasPrefix ( val , " " ) || strings . HasSuffix ( val , " " ) { return " " , fmt . Errorf ( " " , val ) } return val , nil }
ValidateIndexName validates an index name.
ValidateIndexName validates an index name .
// 'index.docker.io' => 'docker.io' // *TODO: Check if valid hostname[:port]/ip[:port]?