cnabio / cnab-go

A Go implementation of CNAB Core 1.0
MIT License
69 stars 37 forks source link

Fix ULID generation #207

Closed carolynvs closed 4 years ago

carolynvs commented 4 years ago

I was seeing in unit tests where I was generating ULIDs back-to-back that they were not sorting correctly. After digging through the issue queue, it turns out the example on the README of the ulid library we use is not appropriate to copy and use. I believe this is what they recommend based on their replies to a few issues.

radu-matei commented 4 years ago

Oh wow.. So to recap, generating an ULID can panic, and the operation is not thread safe.

Thanks a lot for catching this, I think we can create a new release for this alone once we merge.