You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zap has support for Stringer, which indeed makes the log entries a bit more simple to construct. However, the real power to me would be if it also had a Stringers (plural) function.
Right now, if you have an array of objects that implement fmt.Stringer, you have to manually loop them, extract the strings, and then call zap.Strings. It would be a lot cleaner if we could simply pass them as-is to Stringers and let Zap handle the rest.
The text was updated successfully, but these errors were encountered:
What would the signature of zap.Stringers be? If I have a type *Foo that implements io.Stringer, you can't pass []*Foo as []io.Stringer - you have to allocate a new slice and copy over each element.
Zap has support for
Stringer
, which indeed makes the log entries a bit more simple to construct. However, the real power to me would be if it also had aStringers
(plural) function.Right now, if you have an array of objects that implement
fmt.Stringer
, you have to manually loop them, extract the strings, and then callzap.Strings
. It would be a lot cleaner if we could simply pass them as-is toStringers
and let Zap handle the rest.The text was updated successfully, but these errors were encountered: