func ParseWithAliases(args ...string) (cons Value, aliases map[string]string, err error) {
	aliases = make(map[string]string)
	for _, arg := range args {
		// Replace slash-escaped spaces with a null byte so we can
		// safely split on remaining whitespace.
		arg = strings.Replace(arg, `\ `, "\x00", -1)
		raws := strings.Split(strings.TrimSpace(arg), " ")
		for _, raw := range raws {
			// Replace null bytes back to spaces
			raw = strings.TrimSpace(strings.Replace(raw, "\x00", " ", -1))
			if raw == "" {
				continue
			}
			name, val, err := splitRaw(raw)
			if err != nil {
				return Value{}, nil, errors.Trace(err)
			}
			if canonical, ok := rawAliases[name]; ok {
				aliases[name] = canonical
				name = canonical
			}
			if err := cons.setRaw(name, val); err != nil {
				return Value{}, aliases, errors.Trace(err)
			}
		}
	}
	return cons, aliases, nil
}
// ParseWithAliases constructs a constraints.Value from the supplied arguments, each
// of which must contain only spaces and name=value pairs. If any name is
// specified more than once, an error is returned.  The aliases map returned
// contains a map of aliases used, and their canonical values.
ParseWithAliases constructs a constraints.Value from the supplied arguments, each
of which must contain only spaces and name=value pairs. If any name is
specified more than once, an error is returned.  The aliases map returned
contains a map of aliases used, and their canonical values.
// ParseWithAliases constructs a constraints . Value from the supplied arguments each // of which must contain only spaces and name = value pairs . If any name is // specified more than once an error is returned . The aliases map returned // contains a map of aliases used and their canonical values .
func ParseWithAliases(args ...string) (cons Value, aliases map[string]string, err error) {
	aliases = make(map[string]string)
	for _, arg := range args {
		arg = strings.Replace(arg, `\ `, "\x00", -1)
		raws := strings.Split(strings.TrimSpace(arg), " ")
		for _, raw := range raws {
			raw = strings.TrimSpace(strings.Replace(raw, "\x00", " ", -1))
			if raw == "" {
				continue
			}
			name, val, err := splitRaw(raw)
			if err != nil {
				return Value{}, nil, errors.Trace(err)
			}
			if canonical, ok := rawAliases[name]; ok {
				aliases[name] = canonical
				name = canonical
			}
			if err := cons.setRaw(name, val); err != nil {
				return Value{}, aliases, errors.Trace(err)
			}
		}
	}
	return cons, aliases, nil
}
func ParseWithAliases ( args ... string ) ( cons Value , aliases map [ string ] string , err error ) { aliases = make ( map [ string ] string ) for _ , arg := range args { arg = strings . Replace ( arg , `\ ` , " \x00 " , - 1 ) raws := strings . Split ( strings . TrimSpace ( arg ) , " " ) for _ , raw := range raws { raw = strings . TrimSpace ( strings . Replace ( raw , " \x00 " , " " , - 1 ) ) if raw == " " { continue } name , val , err := splitRaw ( raw ) if err != nil { return Value { } , nil , errors . Trace ( err ) } if canonical , ok := rawAliases [ name ] ; ok { aliases [ name ] = canonical name = canonical } if err := cons . setRaw ( name , val ) ; err != nil { return Value { } , aliases , errors . Trace ( err ) } } } return cons , aliases , nil }
ParseWithAliases constructs a constraints.Value from the supplied arguments, each
of which must contain only spaces and name=value pairs.
ParseWithAliases constructs a constraints . Value from the supplied arguments each of which must contain only spaces and name = value pairs .
// Replace slash-escaped spaces with a null byte so we can // safely split on remaining whitespace. // Replace null bytes back to spaces