Skip to content

Consider making the Stringers function generic? #551

@fgimian

Description

@fgimian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions