func Must(uuid UUID, err error) UUID {
	if err != nil {
		panic(err)
	}
	return uuid
}
Must returns uuid if err is nil and panics otherwise.
package uuid
import (
	"bytes"
	"crypto/rand"
	"encoding/hex"
	"errors"
	"fmt"
	"io"
	"strings"
)
type UUID [16]byte
type Version byte
type Variant byte
const (
	Invalid   = Variant(iota)  
	RFC4122                    
	Reserved                   
	Microsoft                  
	Future                     
)
var rander = rand.Reader  
func Parse(s string) (UUID, error) {
	var uuid UUID
	if len(s) != 36 {
		if len(s) != 36+9 {
			return uuid, fmt.Errorf("invalid UUID length: %d", len(s))
		}
		if strings.ToLower(s[:9]) != "urn:uuid:" {
			return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9])
		}
		s = s[9:]
	}
	if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
		return uuid, errors.New("invalid UUID format")
	}
	for i, x := range [16]int{
		0, 2, 4, 6,
		9, 11,
		14, 16,
		19, 21,
		24, 26, 28, 30, 32, 34} {
		if v, ok := xtob(s[x], s[x+1]); !ok {
			return uuid, errors.New("invalid UUID format")
		} else {
			uuid[i] = v
		}
	}
	return uuid, nil
}
func ParseBytes(b []byte) (UUID, error) {
	var uuid UUID
	if len(b) != 36 {
		if len(b) != 36+9 {
			return uuid, fmt.Errorf("invalid UUID length: %d", len(b))
		}
		if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) {
			return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9])
		}
		b = b[9:]
	}
	if b[8] != '-' || b[13] != '-' || b[18] != '-' || b[23] != '-' {
		return uuid, errors.New("invalid UUID format")
	}
	for i, x := range [16]int{
		0, 2, 4, 6,
		9, 11,
		14, 16,
		19, 21,
		24, 26, 28, 30, 32, 34} {
		if v, ok := xtob(b[x], b[x+1]); !ok {
			return uuid, errors.New("invalid UUID format")
		} else {
			uuid[i] = v
		}
	}
	return uuid, nil
}