func Labels(name string) (labels []string, err error) {
	if name == "." || len(name) == 0 {
		return []string{""}, nil
	}

	if len(name) > 255 { // RFC 3696
		return nil, fmt.Errorf("invalid name %q, len > 255", name)
	}

	for name != "" {
		i := strings.Index(name, ".")
		if i < 0 {
			if len(name) > 63 {
				return nil, fmt.Errorf("invalid label %q, len > 63", name)
			}
			labels = append(labels, name)
			return
		}

		label := name[:i]
		if len(label) > 63 {
			return nil, fmt.Errorf("invalid label %q, len > 63", label)
		}
		labels = append(labels, label)
		name = name[i+1:]
	}

	labels = append(labels, "")
	return
}
// Labels returns a domain name labels or an Error if any.
Labels returns a domain name labels or an Error if any.
// Labels returns a domain name labels or an Error if any .
func Labels(name string) (labels []string, err error) {
	if name == "." || len(name) == 0 {
		return []string{""}, nil
	}
	if len(name) > 255 { 
		return nil, fmt.Errorf("invalid name %q, len > 255", name)
	}
	for name != "" {
		i := strings.Index(name, ".")
		if i < 0 {
			if len(name) > 63 {
				return nil, fmt.Errorf("invalid label %q, len > 63", name)
			}
			labels = append(labels, name)
			return
		}
		label := name[:i]
		if len(label) > 63 {
			return nil, fmt.Errorf("invalid label %q, len > 63", label)
		}
		labels = append(labels, label)
		name = name[i+1:]
	}
	labels = append(labels, "")
	return
}
func Labels ( name string ) ( labels [ ] string , err error ) { if name == " " || len ( name ) == 0 { return [ ] string { " " } , nil } if len ( name ) > 255 { return nil , fmt . Errorf ( " " , name ) } for name != " " { i := strings . Index ( name , " " ) if i < 0 { if len ( name ) > 63 { return nil , fmt . Errorf ( " " , name ) } labels = append ( labels , name ) return } label := name [ : i ] if len ( label ) > 63 { return nil , fmt . Errorf ( " " , label ) } labels = append ( labels , label ) name = name [ i + 1 : ] } labels = append ( labels , " " ) return }
Labels returns a domain name labels or an Error if any.
Labels returns a domain name labels or an Error if any .
// RFC 3696