func (c URLsMap) String() string {
	var pairs []string
	for name, urls := range c {
		for _, url := range urls {
			pairs = append(pairs, fmt.Sprintf("%s=%s", name, url.String()))
		}
	}
	sort.Strings(pairs)
	return strings.Join(pairs, ",")
}
String turns URLsMap into discovery-formatted name-to-URLs sorted by name.
package types
import (
	"fmt"
	"sort"
	"strings"
)
type URLsMap map[string]URLs
func NewURLsMap(s string) (URLsMap, error) {
	m := parse(s)
	cl := URLsMap{}
	for name, urls := range m {
		us, err := NewURLs(urls)
		if err != nil {
			return nil, err
		}
		cl[name] = us
	}
	return cl, nil
}
func NewURLsMapFromStringMap(m map[string]string, sep string) (URLsMap, error) {
	var err error
	um := URLsMap{}
	for k, v := range m {
		um[k], err = NewURLs(strings.Split(v, sep))
		if err != nil {
			return nil, err
		}
	}
	return um, nil
}