We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 301b082 commit 0d25616Copy full SHA for 0d25616
common.go
@@ -8,6 +8,7 @@ import (
8
"crypto/rand"
9
"encoding/binary"
10
"encoding/hex"
11
+ "fmt"
12
"os"
13
"reflect"
14
"runtime"
@@ -31,12 +32,12 @@ func UUID() string {
31
32
// Setup seed & counter once
33
uuidSetup.Do(func() {
34
if _, err := rand.Read(uuidSeed[:]); err != nil {
- return
35
+ panic(fmt.Sprintf("utils: failed to seed UUID generator: %v", err))
36
}
37
uuidCounter = binary.LittleEndian.Uint64(uuidSeed[:8])
38
})
39
if atomic.LoadUint64(&uuidCounter) <= 0 {
- return "00000000-0000-0000-0000-000000000000"
40
+ panic("utils: UUID counter is not properly initialized")
41
42
// first 8 bytes differ, taking a slice of the first 16 bytes
43
x := atomic.AddUint64(&uuidCounter, 1)
0 commit comments