func Parse(src []string, allowEmptyValues bool) (map[string]string, error) {
	results := map[string]string{}
	for _, kv := range src {
		if kv == "" {
			continue
		}
		parts := strings.SplitN(kv, "=", 2)
		if len(parts) != 2 {
			return nil, fmt.Errorf(`expected "key=value", got %q`, kv)
		}
		key, value := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1])
		if len(key) == 0 || (!allowEmptyValues && len(value) == 0) {
			return nil, fmt.Errorf(`expected "key=value", got "%s=%s"`, key, value)
		}
		if _, exists := results[key]; exists {
			return nil, DuplicateError(fmt.Sprintf("key %q specified more than once", key))
		}
		results[key] = value
	}
	return results, nil
}
// Parse parses the supplied string slice into a map mapping
// keys to values. Duplicate keys cause an error to be returned.
Parse parses the supplied string slice into a map mapping
keys to values. Duplicate keys cause an error to be returned.
// Parse parses the supplied string slice into a map mapping // keys to values . Duplicate keys cause an error to be returned .
func Parse(src []string, allowEmptyValues bool) (map[string]string, error) {
	results := map[string]string{}
	for _, kv := range src {
		if kv == "" {
			continue
		}
		parts := strings.SplitN(kv, "=", 2)
		if len(parts) != 2 {
			return nil, fmt.Errorf(`expected "key=value", got %q`, kv)
		}
		key, value := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1])
		if len(key) == 0 || (!allowEmptyValues && len(value) == 0) {
			return nil, fmt.Errorf(`expected "key=value", got "%s=%s"`, key, value)
		}
		if _, exists := results[key]; exists {
			return nil, DuplicateError(fmt.Sprintf("key %q specified more than once", key))
		}
		results[key] = value
	}
	return results, nil
}
func Parse ( src [ ] string , allowEmptyValues bool ) ( map [ string ] string , error ) { results := map [ string ] string { } for _ , kv := range src { if kv == " " { continue } parts := strings . SplitN ( kv , " " , 2 ) if len ( parts ) != 2 { return nil , fmt . Errorf ( `expected "key=value", got %q` , kv ) } key , value := strings . TrimSpace ( parts [ 0 ] ) , strings . TrimSpace ( parts [ 1 ] ) if len ( key ) == 0 || ( ! allowEmptyValues && len ( value ) == 0 ) { return nil , fmt . Errorf ( `expected "key=value", got "%s=%s"` , key , value ) } if _ , exists := results [ key ] ; exists { return nil , DuplicateError ( fmt . Sprintf ( " " , key ) ) } results [ key ] = value } return results , nil }
Parse parses the supplied string slice into a map mapping
keys to values.
Parse parses the supplied string slice into a map mapping keys to values .