File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -25,20 +25,17 @@ const toUpperTable = "\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x10\x11
2525
2626var uuidSeed [24 ]byte
2727var uuidCounter uint64
28- var uuidSetup sync.Once
28+ var UUIDSetup sync.Once
2929
3030// UUID generates an universally unique identifier (UUID)
3131func UUID () string {
3232 // Setup seed & counter once
33- uuidSetup .Do (func () {
33+ UUIDSetup .Do (func () {
3434 if _ , err := rand .Read (uuidSeed [:]); err != nil {
3535 panic (fmt .Sprintf ("utils: failed to seed UUID generator: %v" , err ))
3636 }
3737 uuidCounter = binary .LittleEndian .Uint64 (uuidSeed [:8 ])
3838 })
39- if atomic .LoadUint64 (& uuidCounter ) <= 0 {
40- panic ("utils: UUID counter is not properly initialized" )
41- }
4239 // first 8 bytes differ, taking a slice of the first 16 bytes
4340 x := atomic .AddUint64 (& uuidCounter , 1 )
4441 uuid := uuidSeed
You can’t perform that action at this time.
0 commit comments