Permalink
Browse files

add demo

  • Loading branch information...
1 parent 2a9249d commit 0279960e68d2ca726bb7b9170220e383da720f54 buzzlight committed Jun 20, 2012
Showing with 43 additions and 1 deletion.
  1. +23 −1 README.md
  2. +20 −0 example/demo.go
View
@@ -1,4 +1,26 @@
gosnow
======
-snowflake in golang
+snowflake in golang
+
+---how to use
+
+~~~golang
+package main
+
+import (
+ "github.com/sdming/gosnow"
+ "fmt"
+)
+
+func main() {
+
+ v := gosnow.Default()
+ //v := gosnow.NewSnowFlake(100)
+ for i := 0; i < 10; i++ {
+ id := v.Next()
+ fmt.Println(id)
+ }
+}
+
+~~~
View
@@ -0,0 +1,20 @@
+/*
+github.com/twitter/snowflake in golang
+*/
+
+package main
+
+import (
+ "github.com/sdming/gosnow"
+ "fmt"
+)
+
+func main() {
+
+ v := gosnow.Default()
+ //v := gosnow.NewSnowFlake(100)
+ for i := 0; i < 10; i++ {
+ id := v.Next()
+ fmt.Println(id)
+ }
+}

0 comments on commit 0279960

Please sign in to comment.