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) }