chore: add uuid

This commit is contained in:
zchengo
2023-01-30 15:43:48 +08:00
parent 54a66cb915
commit a0d9f3ceb4
3 changed files with 19 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package common
import (
"log"
"github.com/gofrs/uuid"
)
// 生成UUID
func GenUUID() string {
u, err := uuid.NewV4()
if err != nil {
log.Fatalf("failed to generate UUID: %v", err)
}
return u.String()
}