acmetool: fix patch: panic when uuid.NewV4() fails
This commit is contained in:
parent
91ddbde10d
commit
619ea38c17
1 changed files with 2 additions and 3 deletions
|
@ -1,12 +1,11 @@
|
||||||
--- storage/types.go.orig 2018-01-11 08:57:49.339089353 +0100
|
--- storage/types.go.orig 2018-01-11 08:57:49.339089353 +0100
|
||||||
+++ storage/types.go 2018-01-11 08:58:12.707027749 +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] + "-"
|
nprefix = tgt.Satisfy.Names[0] + "-"
|
||||||
}
|
}
|
||||||
|
|
||||||
- b := uuid.NewV4().Bytes()
|
- b := uuid.NewV4().Bytes()
|
||||||
+ u, _ := uuid.NewV4()
|
+ b := uuid.Must(uuid.NewV4()).Bytes()
|
||||||
+ b := u.Bytes()
|
|
||||||
str := strings.ToLower(strings.TrimRight(base32.StdEncoding.EncodeToString(b), "="))
|
str := strings.ToLower(strings.TrimRight(base32.StdEncoding.EncodeToString(b), "="))
|
||||||
|
|
||||||
tgt.Filename = nprefix + str
|
tgt.Filename = nprefix + str
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue