// Sorts and joins the labels with a new space delimiter
Sorts and joins the labels with a new space delimiter
// Sorts and joins the labels with a new space delimiter
func sortAndJoinLabels(labels map[string]string) string {
	result := ""
	keys := make([]string, 0, len(labels))
	for k := range labels {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	for _, k := range keys {
		result = addCharIfNotEmpty(result, "\n") + fmt.Sprintf("%s=%s", k, labels[k])
	}
	return result
}
func sortAndJoinLabels ( labels map [ string ] string ) string { result := " " keys := make ( [ ] string , 0 , len ( labels ) ) for k := range labels { keys = append ( keys , k ) } sort . Strings ( keys ) for _ , k := range keys { result = addCharIfNotEmpty ( result , " \n " ) + fmt . Sprintf ( " " , k , labels [ k ] ) } return result }
Sorts and joins the labels with a new space delimiter
Sorts and joins the labels with a new space delimiter