summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/google/uuid/version1.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/uuid/version1.go')
-rw-r--r--vendor/github.com/google/uuid/version1.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/github.com/google/uuid/version1.go b/vendor/github.com/google/uuid/version1.go
index 199a1ac6..46310962 100644
--- a/vendor/github.com/google/uuid/version1.go
+++ b/vendor/github.com/google/uuid/version1.go
@@ -17,12 +17,6 @@ import (
//
// In most cases, New should be used.
func NewUUID() (UUID, error) {
- nodeMu.Lock()
- if nodeID == zeroID {
- setNodeInterface("")
- }
- nodeMu.Unlock()
-
var uuid UUID
now, seq, err := GetTime()
if err != nil {
@@ -38,7 +32,13 @@ func NewUUID() (UUID, error) {
binary.BigEndian.PutUint16(uuid[4:], timeMid)
binary.BigEndian.PutUint16(uuid[6:], timeHi)
binary.BigEndian.PutUint16(uuid[8:], seq)
+
+ nodeMu.Lock()
+ if nodeID == zeroID {
+ setNodeInterface("")
+ }
copy(uuid[10:], nodeID[:])
+ nodeMu.Unlock()
return uuid, nil
}