Skip to content

Commit b7e78d0

Browse files
authored
Merge pull request moby#5025 from thaJeztah/identity_stdlib
identity: remove pkg/errors
2 parents 2aff238 + dca58dc commit b7e78d0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

identity/randomid.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
package identity
22

33
import (
4-
cryptorand "crypto/rand"
4+
"crypto/rand"
55
"io"
66
"math/big"
7-
8-
"github.com/pkg/errors"
97
)
108

119
var (
1210
// idReader is used for random id generation. This declaration allows us to
1311
// replace it for testing.
14-
idReader = cryptorand.Reader
12+
idReader = rand.Reader
1513
)
1614

1715
// parameters for random identifier generation. We can tweak this when there is
@@ -46,7 +44,7 @@ func NewID() string {
4644
var p [randomIDEntropyBytes]byte
4745

4846
if _, err := io.ReadFull(idReader, p[:]); err != nil {
49-
panic(errors.Wrap(err, "failed to read random bytes: %v"))
47+
panic("failed to read random bytes: " + err.Error())
5048
}
5149

5250
p[0] |= 0x80 // set high bit to avoid the need for padding

0 commit comments

Comments
 (0)