acmetool: fix patch: panic when uuid.NewV4() fails

This commit is contained in:
Enno Boland 2018-01-15 19:29:27 +01:00
parent 91ddbde10d
commit 619ea38c17
No known key found for this signature in database
GPG Key ID: D09964719BDE9971

View File

@ -1,12 +1,11 @@
--- storage/types.go.orig 2018-01-11 08:57:49.339089353 +0100
+++ storage/types.go 2018-01-11 08:58:12.707027749 +0100
@@ -194,7 +194,8 @@ func (tgt *Target) ensureFilename() {
@@ -194,7 +194,7 @@ func (tgt *Target) ensureFilename() {
nprefix = tgt.Satisfy.Names[0] + "-"
}
- b := uuid.NewV4().Bytes()
+ u, _ := uuid.NewV4()
+ b := u.Bytes()
+ b := uuid.Must(uuid.NewV4()).Bytes()
str := strings.ToLower(strings.TrimRight(base32.StdEncoding.EncodeToString(b), "="))
tgt.Filename = nprefix + str