gofrs / uuid

A UUID package for Go
MIT License
1.57k stars 110 forks source link

Generator with options #111

Closed LeonanCarvalho closed 1 year ago

LeonanCarvalho commented 1 year ago

I rewrote the PR https://github.com/gofrs/uuid/pull/98 authored by @mlesar based on the @theckman comments and recommendations.

Help is wanted to make it happens, this is a very desirable feature especially to generate UUIDv6 with custom timestamps.

codecov-commenter commented 1 year ago

Codecov Report

Base: 100.00% // Head: 97.93% // Decreases project coverage by -2.06% :warning:

Coverage data is based on head (d0c4244) compared to base (e1079f3). Patch coverage: 66.66% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #111 +/- ## =========================================== - Coverage 100.00% 97.93% -2.07% =========================================== Files 4 4 Lines 411 436 +25 =========================================== + Hits 411 427 +16 - Misses 0 6 +6 - Partials 0 3 +3 ``` | [Impacted Files](https://codecov.io/gh/gofrs/uuid/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gofrs) | Coverage Δ | | |---|---|---| | [generator.go](https://codecov.io/gh/gofrs/uuid/pull/111/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gofrs#diff-Z2VuZXJhdG9yLmdv) | `95.10% <66.66%> (-4.90%)` | :arrow_down: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gofrs). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gofrs)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

LeonanCarvalho commented 1 year ago

@cameracker It would be great to have your review too :)

cameracker commented 1 year ago

@LeonanCarvalho thanks for the submission. What are your thoughts on the decrease of code coverage? Can we get back to 100%?

LeonanCarvalho commented 1 year ago

@LeonanCarvalho thanks for the submission. What are your thoughts on the decrease of code coverage? Can we get back to 100%?

I think we could include tests for nil values since there is an if with default's fallback suggested here https://github.com/gofrs/uuid/pull/111#discussion_r1057721608

https://app.codecov.io/gh/gofrs/uuid/pull/111

LeonanCarvalho commented 1 year ago

Does something flaky on those tests? I ran it on my repo and it passed https://github.com/LeonanCarvalho/uuid/actions/runs/3788789705

LeonanCarvalho commented 1 year ago

I found out that pkg x/tools cover is no longer active and marked as deprecated, that's why the test is falling https://pkg.go.dev/golang.org/x/tools/cmd/cover

LeonanCarvalho commented 1 year ago

I opened another PR to solve this workflow issue https://github.com/gofrs/uuid/pull/115 I would appreciate it if you guys could also take a look at it.

cameracker commented 1 year ago

Thanks @LeonanCarvalho !