Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `uuid.Nil` and `.IsZero()` method This simplifies comparisons with empty ULIDs. Right now, most people are doing something like the following to check if a ULID is non-zero: ```go id.Compare(ulid.ULID{}) == 0 ``` This requires allocating a new empty ULID each time. Some packages avoid this by creating their own global (or private) nil ULIDs on initialization. This should be built in and simple for better perf & a cleaner API. * Update ulid.go * Update ulid.go * Update ulid.go * Update ulid_test.go * Update ulid_test.go --------- Co-authored-by: Peter Bourgon <[email protected]>
- Loading branch information