id_worker.go
280 字节
package repository
import (
"github.com/linmadan/egglib-go/utils/snowflake"
)
var IdWorker *snowflake.IdWorker
func init() {
worker, err := snowflake.NewIdWorker(2)
if err != nil {
//log.Logger.Panic("idWorker init err" + err.Error())
panic(err)
}
IdWorker = worker
}