rs / zerolog

Zero Allocation JSON Logger
MIT License
10.4k stars 567 forks source link

Consider making the Stringers function generic? #551

Open fgimian opened 1 year ago

fgimian commented 1 year ago

Hey there, would you consider making Stringers generic similar to zap as seen at https://github.com/uber-go/zap/blob/master/array_go118.go#L145 ?

This would make it possible to pass a slice of any type which implements String() as opposed to having to allocate a new slice of fmt.Stringer in the current implementation.

I believe the behavioural change won't be a breaking change for existing users and only make the function more flexible, but it will mean that Go 1.18+ would be required.

Please let me know what you think 😄 Fotis