Background
https://pkg.go.dev/github.com/gofrs/uuid?utm_source=godoc
gofrs is used by the the event store DB Go SDK. Currently, there isn't a clean way to convert between the two types, because we have wrapped the underlying [16]byte byte array in a struct. Below is what I have currently been doing.
ID, err := gofrs.FromString(m.EventID().String())
Potential Solutions
- Cast the underlying byte array to the gofrs uuid then return that. Implementation would be something like follows
func (uuid UUID) GofrsUUID() gofrs.UUID
- Return the underlying byte array through a method so that gofrs can parse it. (this way is a little more verbose but it is cleaner
func (uuid UUID) Bytes() []byte
id, err := gofrs.FromBytes(uuid.New())
Other considerations
We will likely need a way to go gofrs uuid -> caring uuid
Background
https://pkg.go.dev/github.com/gofrs/uuid?utm_source=godoc
gofrs is used by the the event store DB Go SDK. Currently, there isn't a clean way to convert between the two types, because we have wrapped the underlying
[16]bytebyte array in a struct. Below is what I have currently been doing.Potential Solutions
Other considerations
We will likely need a way to go
gofrs uuid -> caring uuid