2013-06-18 23:04:48 +04:00
|
|
|
package uuid_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/satori/uuid"
|
|
|
|
)
|
|
|
|
|
|
|
|
func ExampleNewV1() {
|
|
|
|
u1, err := uuid.NewV1()
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error: ", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println(u1)
|
|
|
|
}
|
|
|
|
|
2013-06-19 01:48:27 +04:00
|
|
|
func ExampleNewV2() {
|
|
|
|
u2, err := uuid.NewV2(uuid.DomainPerson)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error: ", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println(u2)
|
|
|
|
}
|
|
|
|
|
2013-06-18 23:04:48 +04:00
|
|
|
func ExampleNewV3() {
|
|
|
|
u3, err := uuid.NewV3(uuid.NamespaceDNS, "golang.org")
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error: ", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println(u3)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleNewV4() {
|
|
|
|
u4, err := uuid.NewV4()
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error: ", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println(u4)
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleNewV5() {
|
|
|
|
u5, err := uuid.NewV5(uuid.NamespaceDNS, "golang.org")
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error: ", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
fmt.Println(u5)
|
|
|
|
}
|