diff --git a/snowflake.go b/snowflake.go index fa6b034..0327a6d 100644 --- a/snowflake.go +++ b/snowflake.go @@ -26,9 +26,10 @@ var Epoch int64 = 1288834974657 // node type Node struct { sync.Mutex - time int64 - node int64 - step int64 + time int64 + node int64 + step int64 + timebits int64 } // An ID is a custom type used for a snowflake ID. This is used so we can @@ -51,7 +52,7 @@ func NewNode(node int64) (*Node, error) { } // Generate creates and returns a unique snowflake ID -func (n *Node) Generate() (ID, error) { +func (n *Node) Generate() ID { n.Lock() defer n.Unlock() @@ -75,7 +76,7 @@ func (n *Node) Generate() (ID, error) { return ID((now-Epoch)<