Skip to content

Instantly share code, notes, and snippets.

@riton
Created September 19, 2017 10:06
Show Gist options
  • Save riton/d1b862902dab3a11bf96954b07e8fb24 to your computer and use it in GitHub Desktop.
Save riton/d1b862902dab3a11bf96954b07e8fb24 to your computer and use it in GitHub Desktop.
Go test question
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