this post was submitted on 07 Oct 2025
423 points (99.1% liked)
Programmer Humor
26827 readers
1989 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I can see how this may be useful. My understanding is that this is go lang and the person created a wrapper type
UUID
and this function takes the go standard libraryuuid.UUID
and returns the wrappedUUID
.The wrapped
UUID
could be useful as you can then define methods for it liketoInt()
or something to make it implement someID
interface you have set up. It's a common pattern in go to create a thin wrapper around an imported type so you can implement all the methods required for some interface you defined. It does make naming those thin wrappers hard because what are you supposed to name the struct that just contains a uuid?Yep, that person would be me and that's exactly what I was doing, just found it funny that there was so many uuids in the piece of code.
Originally the function was named
FromUuid
but I couldn't resist renaming it to make it even better.Clearly, the answer is uuid.