From 0d7c2f28b18d3136efbe5e299aace247fd86f893 Mon Sep 17 00:00:00 2001 From: Doflatango Date: Thu, 11 Apr 2019 20:54:38 +0800 Subject: [PATCH] fixed NextID() generate duplicate id when restarts the web process multiple times --- id.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/id.go b/id.go index bec781c..eaada4e 100644 --- a/id.go +++ b/id.go @@ -15,5 +15,5 @@ func initID() (err error) { func NextID() string { id := generator.Next() - return hex.EncodeToString(id[:4]) + return hex.EncodeToString(id[:]) }