Open davidspiess opened 1 year ago
The issue is actually deeper: the code does not do what its comments describe, on both NULL values, empty strings and empty byte slices. The comments say "if an empty UUID comes from a table, we return a null UUID", but actually what happens is:
uuid.Nil
as return a null UUID should probably be interpretedSee https://github.com/google/uuid/blob/v1.3.0/sql.go#L17. for details.
Sample program showing the issue (bug ?) https://go.dev/play/p/EzXldTzj4X_u. Run it locally: playground does not support CGO.
Release 1.3.0 introduced the uuid.Valid
field partly for such cases, but that field is not actually used. Maybe the changes to sql.go
which used that new feature were not committed when building the release ?
Thank you for this repository code. Me and my team leader are using this to make our recipe blog project for college a whole lot smoother.