Stringers constructs a field with the given key, holding a list of the output provided by the value's String method Given an object that implements String on the value receiver, you can log a slice of those objects with Objects like so: type Request struct{ ... } func (a Request) String() string
(key string, values []T)
| 214 | // That is, if you're trying to marshal a []Request, the String method |
| 215 | // must be declared on the Request type, not its pointer (*Request). |
| 216 | func Stringers[T fmt.Stringer](key string, values []T) Field { |
| 217 | return Array(key, stringers[T](values)) |
| 218 | } |
| 219 | |
| 220 | type stringers[T fmt.Stringer] []T |
| 221 |