We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Generate
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In line 141: if now == n.time {, I think it has a little problem:
if now == n.time {
If the time on the machine falls back(now<n.time), duplicate IDS will be generated.
The right way should be like sonyflke (https://github.com/sony/sonyflake/blob/master/sonyflake.go#L96)
This project has the most stars on github. I hope it's perfect. Haha.
The text was updated successfully, but these errors were encountered:
Maybe take a look at the details in this PR :)
#18
In Go, 1.9 and later, time package uses a monotonic clock for time-measuring operations.
Sorry, something went wrong.
No branches or pull requests
In line 141:
if now == n.time {
, I think it has a little problem:If the time on the machine falls back(now<n.time), duplicate IDS will be generated.
The right way should be like sonyflke (https://github.com/sony/sonyflake/blob/master/sonyflake.go#L96)
This project has the most stars on github. I hope it's perfect. Haha.
The text was updated successfully, but these errors were encountered: