feat: UUIDs slice type with Strings() convenience method#133
Merged
bormanp merged 4 commits intogoogle:masterfrom Oct 26, 2023
dzbee:feature/strings-from-slices
Merged
feat: UUIDs slice type with Strings() convenience method#133bormanp merged 4 commits intogoogle:masterfrom dzbee:feature/strings-from-slices
bormanp merged 4 commits intogoogle:masterfrom
dzbee:feature/strings-from-slices
Conversation
bormanp
suggested changes
Oct 25, 2023
uuid.go
Outdated
| // UUIDs is a slice of UUID types | ||
| type UUIDs []UUID | ||
|
|
||
| // Strings returns a slice of the string form of each UUID in the received slice of UUIDs |
Contributor
There was a problem hiding this comment.
// Strings returns a string slice containing the string form of each UUID in uuids.
bormanp
approved these changes
Oct 25, 2023
Contributor
bormanp
left a comment
There was a problem hiding this comment.
Thank you for your addition to the UUID package.
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Oct 26, 2023
🤖 I have created a release *beep* *boop* --- ## [1.4.0](https://togithub.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) ### Features * UUIDs slice type with Strings() convenience method ([#133](https://togithub.com/google/uuid/issues/133)) ([cd5fbbd](https://togithub.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4)) ### Fixes * Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
|
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 |
tkarrass
pushed a commit
to tkarrass/uuid
that referenced
this pull request
Sep 11, 2024
* feat: add uuid slice type with strings convenience method * test: benchmark new UUIDs.Strings() feature * docs: improve comments on UUIDs * fix: typos in UUIDs strings benchmark
tkarrass
pushed a commit
to tkarrass/uuid
that referenced
this pull request
Sep 11, 2024
🤖 I have created a release *beep* *boop* --- ## [1.4.0](https://togithub.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) ### Features * UUIDs slice type with Strings() convenience method ([google#133](https://togithub.com/google/uuid/issues/133)) ([cd5fbbd](https://togithub.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4)) ### Fixes * Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.