在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:satori/go.uuid开源软件地址:https://github.com/satori/go.uuid开源编程语言:Go 100.0%开源软件介绍:UUID package for Go languageThis package provides pure Go implementation of Universally Unique Identifier (UUID). Supported both creation and parsing of UUIDs. With 100% test coverage and benchmarks out of box. Supported versions:
InstallationUse the
RequirementsUUID package tested against Go >= 1.6. Examplepackage main
import (
"fmt"
"github.com/satori/go.uuid"
)
func main() {
// Creating UUID Version 4
// panic on error
u1 := uuid.Must(uuid.NewV4())
fmt.Printf("UUIDv4: %s\n", u1)
// or error handling
u2, err := uuid.NewV4()
if err != nil {
fmt.Printf("Something went wrong: %s", err)
return
}
fmt.Printf("UUIDv4: %s\n", u2)
// Parsing UUID from string input
u2, err := uuid.FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
if err != nil {
fmt.Printf("Something went wrong: %s", err)
return
}
fmt.Printf("Successfully parsed: %s", u2)
} DocumentationDocumentation is hosted at GoDoc project. LinksCopyrightCopyright (C) 2013-2018 by Maxim Bublis [email protected]. UUID package released under MIT License. See LICENSE for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论