Merge pull request #140 from shunfei/fix/id-gen

fixed NextID() generate duplicate id when restarts the web process multiple times
pull/157/head
QLeelulu 2019-06-26 15:23:32 +08:00 committed by GitHub
commit 6b8ba934a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {
id := generator.Next()
return hex.EncodeToString(id[:4])
return hex.EncodeToString(id[:])
}