Beispiel #1
0
// mustGetUUID - get a random UUID.
func mustGetUUID() string {
	uuid, err := uuid.New()
	if err != nil {
		panic(fmt.Sprintf("Random UUID generation failed. Error: %s", err))
	}

	return uuid.String()
}
Beispiel #2
0
// getUUID() - get a unique uuid.
func getUUID() (uuidStr string) {
	for {
		uuid, err := uuid.New()
		if err != nil {
			errorIf(err, "Unable to initialize uuid")
			continue
		}
		uuidStr = uuid.String()
		break
	}
	return uuidStr
}