Skip to content

Instantly share code, notes, and snippets.

@souvikhaldar
Created October 25, 2018 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save souvikhaldar/912ae527f38dca1381cc78615230a6d5 to your computer and use it in GitHub Desktop.
Save souvikhaldar/912ae527f38dca1381cc78615230a6d5 to your computer and use it in GitHub Desktop.
Generate Random UUID using Golang and gouuid
import "github.com/nu7hatch/gouuid"
func randToken() (string, error) {
// Using UUID V5 for generating the Token
u4, err := uuid.NewV4()
UUIDtoken := u4.String()
if err != nil {
logrus.Errorln("error:", err)
return "", err
}
return UUIDtoken, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment