427
you are viewing a single comment's thread
view the rest of the comments
[-] Not_mikey@lemmy.dbzer0.com 22 points 2 months ago* (last edited 2 months ago)

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 library uuid.UUID and returns the wrapped UUID.

The wrapped UUID could be useful as you can then define methods for it like toInt() or something to make it implement some ID 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?

[-] rikudou@lemmings.world 17 points 2 months ago

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.

[-] ByteJunk@lemmy.world 6 points 2 months ago

Clearly, the answer is uuid.

this post was submitted on 07 Oct 2025
427 points (99.1% liked)

Programmer Humor

27720 readers
136 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

founded 2 years ago
MODERATORS