fixing dependencies
This commit is contained in:
parent
484401689b
commit
29ccc35dd5
21
vendor/github.com/hashicorp/nomad/helper/uuid/uuid.go
generated
vendored
Normal file
21
vendor/github.com/hashicorp/nomad/helper/uuid/uuid.go
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
package uuid
|
||||
|
||||
import (
|
||||
crand "crypto/rand"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Generate is used to generate a random UUID
|
||||
func Generate() string {
|
||||
buf := make([]byte, 16)
|
||||
if _, err := crand.Read(buf); err != nil {
|
||||
panic(fmt.Errorf("failed to read random bytes: %v", err))
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%08x-%04x-%04x-%04x-%12x",
|
||||
buf[0:4],
|
||||
buf[4:6],
|
||||
buf[6:8],
|
||||
buf[8:10],
|
||||
buf[10:16])
|
||||
}
|
Loading…
Reference in a new issue