func KeyByFields(nameValues ...interface{}) *value.FieldList {
	if len(nameValues)%2 != 0 {
		panic("must have a value for every name")
	}
	out := value.FieldList{}
	for i := 0; i < len(nameValues)-1; i += 2 {
		out = append(out, value.Field{Name: nameValues[i].(string), Value: value.NewValueInterface(nameValues[i+1])})
	}
	out.Sort()
	return &out
}
// KeyByFields is a helper function which constructs a key for an associative
// list type. `nameValues` must have an even number of entries, alternating
// names (type must be string) with values (type must be value.Value). If these
// conditions are not met, KeyByFields will panic--it's intended for static
// construction and shouldn't have user-produced values passed to it.
KeyByFields is a helper function which constructs a key for an associative
list type. `nameValues` must have an even number of entries, alternating
names (type must be string) with values (type must be value.Value). If these
conditions are not met, KeyByFields will panic--it's intended for static
construction and shouldn't have user-produced values passed to it.
// KeyByFields is a helper function which constructs a key for an associative // list type . ` nameValues ` must have an even number of entries alternating // names ( type must be string ) with values ( type must be value . Value ) . If these // conditions are not met KeyByFields will panic -- it ' s intended for static // construction and shouldn ' t have user - produced values passed to it .
func KeyByFields(nameValues ...interface{}) *value.FieldList {
	if len(nameValues)%2 != 0 {
		panic("must have a value for every name")
	}
	out := value.FieldList{}
	for i := 0; i < len(nameValues)-1; i += 2 {
		out = append(out, value.Field{Name: nameValues[i].(string), Value: value.NewValueInterface(nameValues[i+1])})
	}
	out.Sort()
	return &out
}
func KeyByFields ( nameValues ... interface { } ) * value . FieldList { if len ( nameValues ) % 2 != 0 { panic ( " " ) } out := value . FieldList { } for i := 0 ; i < len ( nameValues ) - 1 ; i += 2 { out = append ( out , value . Field { Name : nameValues [ i ] . ( string ) , Value : value . NewValueInterface ( nameValues [ i + 1 ] ) } ) } out . Sort ( ) return & out }
KeyByFields is a helper function which constructs a key for an associative
list type.
KeyByFields is a helper function which constructs a key for an associative list type .