From 375cd7a0f5fcf6c92ca02d24b8c61179decd4f41 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Fri, 8 Aug 2025 23:25:17 +0300 Subject: Add more readme info --- pkg/snowflake/snowflake.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/snowflake/snowflake.go') diff --git a/pkg/snowflake/snowflake.go b/pkg/snowflake/snowflake.go index 890f278..d369134 100644 --- a/pkg/snowflake/snowflake.go +++ b/pkg/snowflake/snowflake.go @@ -75,9 +75,9 @@ func NewNode(node int64) *Node { assert.Assert(nodeBits+stepBits == 22, "node and step bits must add up to 22") assert.Assert(0 <= node && node <= NodeMax, "node must be within 0 and NodeMax", "node", node) - // Credit to https://github.com/bwmarrin/snowflake + // NOTE(kyren): Credit to https://github.com/bwmarrin/snowflake currentTime := time.Now() - // add time.Duration to curTime to make sure we use the monotonic clock if available + // add time.Duration to currentTime to make sure we use the monotonic clock if available epoch := currentTime.Add(time.Unix(Epoch/1000, (Epoch%1000)*1000000).Sub(currentTime)) return &Node{ -- cgit v1.3.1