logoalt Hacker News

iaaanyesterday at 8:20 PM3 repliesview on HN

Unfortunately for people SELECTing UUIDs out of a DB directly into a uuid struct, the built-in uuid structs don't implement the necessary interface for that, so you'll have to continue using the google package, or a plain string.


Replies

agwayesterday at 8:51 PM

The database/sql package gained native support[1] for the uuid.UUID type so it will Just Work even without the methods. This probably should have been mentioned in the release notes and database/sql package docs.

[1] https://cs.opensource.google/go/go/+/refs/tags/go1.27.0:src/...

show 1 reply
deepsunyesterday at 8:36 PM

Or just a number (128-bit).

reactordevyesterday at 8:30 PM

Oooof… well played go team, well played.