You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
419 B

3 years ago
package field
type Fields []Field
type MapField map[Key]Value
func (f Fields) Append(fields ...Field) Fields {
f = append(f, fields...)
return f
}
func (f Fields) Set(idx int, field Field) {
f[idx] = field
}
func (f Fields) Len() int {
return len(f)
}
func (f Fields) AsMap() MapField {
3 years ago
fields := make(MapField, len(f))
3 years ago
for _, field := range f {
3 years ago
fields[field.Key()] = field.Value()
3 years ago
}
3 years ago
return fields
3 years ago
}