Skip to content
鼓励作者:欢迎打赏犒劳

go生成UUID

go
package main

import (
	"github.com/google/uuid"
)

// GenerateUUID generates a new UUID and returns it as a string.
// Example: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
func GenerateUUID() string {
	id := uuid.New()
	return id.String()
}

如有转载或 CV 的请标注本站原文地址