str.go 295 Bytes
Newer Older
kzkzzzz's avatar
kzkzzzz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package util

import (
	"fmt"
	uuid "github.com/satori/go.uuid"
	"os"
	"strings"
)

func GenServiceId() string {
	name, _ := os.Hostname()
	return fmt.Sprintf("%s_%s", name, uuid.NewV4().String())
}

func GetRandStrByUUID() string {
	return strings.Replace(uuid.NewV4().String(), "-", "", -1)
}