mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: buildkit, docker/docker and docker/cli v27.0.1
diffs: - https://github.com/docker/cli/compare/v26.1.4..v27.0.1 - https://github.com/docker/docker/compare/v26.1.4..v27.0.1 - https://github.com/moby/buildkit/compare/v0.14.1...aaaf86e5470bffbb395f5c15ad4a1c152642ea30 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
8
vendor/github.com/moby/buildkit/identity/randomid.go
generated
vendored
8
vendor/github.com/moby/buildkit/identity/randomid.go
generated
vendored
@ -1,17 +1,15 @@
|
||||
package identity
|
||||
|
||||
import (
|
||||
cryptorand "crypto/rand"
|
||||
"crypto/rand"
|
||||
"io"
|
||||
"math/big"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
// idReader is used for random id generation. This declaration allows us to
|
||||
// replace it for testing.
|
||||
idReader = cryptorand.Reader
|
||||
idReader = rand.Reader
|
||||
)
|
||||
|
||||
// parameters for random identifier generation. We can tweak this when there is
|
||||
@ -46,7 +44,7 @@ func NewID() string {
|
||||
var p [randomIDEntropyBytes]byte
|
||||
|
||||
if _, err := io.ReadFull(idReader, p[:]); err != nil {
|
||||
panic(errors.Wrap(err, "failed to read random bytes: %v"))
|
||||
panic("failed to read random bytes: " + err.Error())
|
||||
}
|
||||
|
||||
p[0] |= 0x80 // set high bit to avoid the need for padding
|
||||
|
Reference in New Issue
Block a user