gofrs / uuid

A UUID package for Go
MIT License
1.57k stars 110 forks source link

`uuid.UUID.Value` panics with nil pointers #107

Closed abdusco closed 1 year ago

abdusco commented 1 year ago

uuid.UUID.Value is not implemented with pointer receiver, therefore it panics when passing nil values to an SQL query.

value method github.com/gofrs/uuid/v3.UUID.Value called using nil *UUID pointer
dylan-bourque commented 1 year ago

This case is why the NullUUID type exists. It mirrors the behavior of the Null* types in the database/sql package.

cameracker commented 1 year ago

Hi, I believe the API already supports this behavior as of some changes in its latest release. Please let us know if this is still a gap.