Created
September 19, 2017 10:06
-
-
Save riton/d1b862902dab3a11bf96954b07e8fb24 to your computer and use it in GitHub Desktop.
Go test question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package uuidutils | |
import ( | |
"fmt" | |
"github.com/google/uuid" | |
) | |
// GetNewRandomUUID Generate a new random uuid | |
func GetNewRandomUUID() (nuuid string, err error) { | |
uuidObj, err := uuid.NewRandom() | |
if err != nil { | |
return "", fmt.Errorf("error generating a new random uuid: %s", err) | |
} | |
nuuid = uuidObj.String() | |
return nuuid, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment