go.uuid icon indicating copy to clipboard operation
go.uuid copied to clipboard

Update uuid library

Open pzentenoe opened this issue 1 year ago • 2 comments

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

  1. UUID V6 and V7 Implementation:

    • Added NewV6 and NewV7 methods to the Generator interface and their respective implementations in rfc4122Generator.
    • 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.
  2. 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.
  3. Enhancements in SQL Interoperability:

    • Revised and optimized the Scan and Value methods for UUID and NullUUID, ensuring clearer and more robust handling of data in SQL interactions.

Test Updates and Modernization

  1. 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 with testing and testify.
  2. New Tests for UUID V6 and V7:

    • Added unit tests and benchmarks for NewV6 and NewV7, ensuring their correct functionality and performance.
  3. Optimization of Existing Tests:

    • Enhanced tests for existing methods such as Bytes, String, Equal, Version, and Variant to ensure complete and accurate coverage.

CI

  • travis removed
  • github action added

Documentation

  • Add badge to readme.

pzentenoe avatar Aug 10 '24 05:08 pzentenoe

https://github.com/satori/go.uuid/issues/103

cameracker avatar Sep 18 '24 22:09 cameracker

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

cameracker avatar Sep 18 '24 22:09 cameracker