sony / sonyflake

A distributed unique ID generator inspired by Twitter's Snowflake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NewSonyflake() should also return an error

quetzyg opened this issue · comments

At the moment, the sonyflake.NewSonyflake() function only returns a *sonyflake.Sonyflake. While there aren't many reasons for the return value to be nil, it would be great to know what caused a potential error.

Given this package may be in use by a lot of people and in order to keep BC, I propose a new function with two return values (*sonyflake.Sonyflake, error) and mark the current function as deprecated.

Thoughts?