Name: gosnow
Owner: Videolabs
Description: snowflake in golang
Created: 2015-06-22 15:43:36.0
Updated: 2015-06-22 15:43:36.0
Pushed: 2015-06-22 15:48:24.0
Homepage: null
Size: 85
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
gosnow is a snowflake implementation in golang.
This is a fork of the upstream that replaces the the usage of panic() by returning errors instead.
age main
rt (
"github.com/sdming/gosnow"
"fmt"
main() {
v, err := gosnow.Default()
// Alternatively you can set the worker id if you are running multiple snowflakes
// v, err := gosnow.NewSnowFlake(100)
for i := 0; i < 10; i++ {
id, err := v.Next()
fmt.Println(id)
}