fixed NextID() generate duplicate id when restarts the web process multiple times

pull/140/head
Doflatango 2019-04-11 20:54:38 +08:00
parent a282c6de9d
commit 0d7c2f28b1
1 changed files with 1 additions and 1 deletions

2
id.go
View File

@ -15,5 +15,5 @@ func initID() (err error) {
func NextID() string { func NextID() string {
id := generator.Next() id := generator.Next()
return hex.EncodeToString(id[:4]) return hex.EncodeToString(id[:])
} }