google / uuid

Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
BSD 3-Clause "New" or "Revised" License
5.16k stars 362 forks source link

feat: UUIDs slice type with Strings() convenience method #133

Closed dzbee closed 8 months ago

dzbee commented 8 months ago

I often work with slices of UUIDs and want to include them in log messages. It is therefore convenient to be able to easily transform a slice of UUIDs into a slice of strings. In the interest of avoiding repeating code across many projects to accomplish this, I suggest defining a slice type in this project.

This PR adds such a type and defines a convenience method Strings() on it.

This type additionally gives maintainers the opportunity to add further convenience methods; for instance one could implement the sort interface on this new type.

loeffel-io commented 8 months ago

Would love to see also the Scanner and Value interface for the UUID slice in this pkg - i could create a PR for this if there is some interest