go.uuid
go.uuid copied to clipboard
Update uuid library
Pull Request Summary
This Pull Request introduces a series of improvements and updates to the UUID library, including new functionality, code refactoring, and modernization of the tests. Below are the main changes:
Implementation Changes
-
UUID V6 and V7 Implementation:
- Added
NewV6andNewV7methods to theGeneratorinterface and their respective implementations inrfc4122Generator. - UUID V6: Reorders time fields to allow lexicographically sortable UUIDs based on time.
- UUID V7: Utilizes a Unix timestamp combined with random data to generate chronologically sortable UUIDs.
- Added
-
Refactoring of Existing Methods:
- Improved clarity and robustness of key methods like
SetVersion,SetVariant,Must, and others. - Added detailed GoDoc comments to enhance code understanding.
- Improved clarity and robustness of key methods like
-
Enhancements in SQL Interoperability:
- Revised and optimized the
ScanandValuemethods forUUIDandNullUUID, ensuring clearer and more robust handling of data in SQL interactions.
- Revised and optimized the
Test Updates and Modernization
-
Migration to Testify:
- Refactored all existing tests to use
testify, improving readability and the effectiveness of assertions. - Removed outdated dependencies like
gopkg.in/check.v1, adopting a more standard approach withtestingandtestify.
- Refactored all existing tests to use
-
New Tests for UUID V6 and V7:
- Added unit tests and benchmarks for
NewV6andNewV7, ensuring their correct functionality and performance.
- Added unit tests and benchmarks for
-
Optimization of Existing Tests:
- Enhanced tests for existing methods such as
Bytes,String,Equal,Version, andVariantto ensure complete and accurate coverage.
- Enhanced tests for existing methods such as
CI
- travis removed
- github action added
Documentation
- Add badge to readme.
https://github.com/satori/go.uuid/issues/103
Here's a drop in replacement that was forked from this library that already has most (all) of the feature's you've incorporated. We'd welcome some additional contributions.
https://github.com/gofrs/uuid