// Copyright 2019 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. // package id 初始化uniqueId,并提供方法 package id import ( "time" "github.com/sony/sonyflake" ) var sf *sonyflake.Sonyflake func init() { st := sonyflake.Settings{ StartTime: time.Date(2010, time.October, 10, 10, 10, 10, 0, time.UTC), } sf = sonyflake.NewSonyflake(st) if sf == nil { panic("init unique id panic") } }