From c0d0ac2409925f4cbde4debe9566992b0610dda7 Mon Sep 17 00:00:00 2001 From: Peter Schultz Date: Thu, 10 Oct 2019 17:30:06 +0200 Subject: [PATCH] NewRandom: actually panic --- version4.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/version4.go b/version4.go index b459d46..476fe8a 100644 --- a/version4.go +++ b/version4.go @@ -19,8 +19,6 @@ import guuid "github.com/google/uuid" // equivalent to the odds of creating a few tens of trillions of UUIDs in a // year and having one duplicate. func NewRandom() UUID { - if gu, err := guuid.NewRandom(); err == nil { - return UUID(gu[:]) - } - return nil + gu := guuid.Must(guuid.NewRandom()) + return UUID(gu[:]) }