package helper
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func Test_snowflake(t *testing.T) {
|
|
|
|
// 创建一个Snowflake实例
|
|
snowflake := NewSnowflake(169379266710)
|
|
// 生成10个唯一ID并输出
|
|
for i := 0; i < 10; i++ {
|
|
id := snowflake.Generate()
|
|
t.Log(id)
|
|
}
|
|
}
|