常用类型及数据操作方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
255 B

  1. package helper
  2. import (
  3. "testing"
  4. )
  5. func Test_snowflake(t *testing.T) {
  6. // 创建一个Snowflake实例
  7. snowflake := NewSnowflake(169379266710)
  8. // 生成10个唯一ID并输出
  9. for i := 0; i < 10; i++ {
  10. id := snowflake.Generate()
  11. t.Log(id)
  12. }
  13. }