Update go-uuid dependency

There don't seem to be any major changes but we'll update this while we're at
it. This dependency is pretty important for coming changes.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2015-02-05 11:58:43 -08:00
parent 10a194c775
commit 29135602ec
4 changed files with 11 additions and 11 deletions

6
Godeps/Godeps.json generated
View file

@ -1,14 +1,14 @@
{ {
"ImportPath": "github.com/docker/distribution", "ImportPath": "github.com/docker/distribution",
"GoVersion": "go1.4", "GoVersion": "go1.4.1",
"Packages": [ "Packages": [
"./..." "./..."
], ],
"Deps": [ "Deps": [
{ {
"ImportPath": "code.google.com/p/go-uuid/uuid", "ImportPath": "code.google.com/p/go-uuid/uuid",
"Comment": "null-12", "Comment": "null-15",
"Rev": "7dda39b2e7d5e265014674c5af696ba4186679e9" "Rev": "35bc42037350f0078e3c974c6ea690f1926603ab"
}, },
{ {
"ImportPath": "github.com/AdRoll/goamz/aws", "ImportPath": "github.com/AdRoll/goamz/aws",

View file

@ -1,4 +1,4 @@
Copyright (c) 2009 Google Inc. All rights reserved. Copyright (c) 2009,2014 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are modification, are permitted provided that the following conditions are

View file

@ -40,15 +40,15 @@ func (t Time) UnixTime() (sec, nsec int64) {
} }
// GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and // GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and
// adjusts the clock sequence as needed. An error is returned if the current // clock sequence as well as adjusting the clock sequence as needed. An error
// time cannot be determined. // is returned if the current time cannot be determined.
func GetTime() (Time, error) { func GetTime() (Time, uint16, error) {
defer mu.Unlock() defer mu.Unlock()
mu.Lock() mu.Lock()
return getTime() return getTime()
} }
func getTime() (Time, error) { func getTime() (Time, uint16, error) {
t := timeNow() t := timeNow()
// If we don't have a clock sequence already, set one. // If we don't have a clock sequence already, set one.
@ -63,7 +63,7 @@ func getTime() (Time, error) {
clock_seq = ((clock_seq + 1) & 0x3fff) | 0x8000 clock_seq = ((clock_seq + 1) & 0x3fff) | 0x8000
} }
lasttime = now lasttime = now
return Time(now), nil return Time(now), clock_seq, nil
} }
// ClockSequence returns the current clock sequence, generating one if not // ClockSequence returns the current clock sequence, generating one if not

View file

@ -19,7 +19,7 @@ func NewUUID() UUID {
SetNodeInterface("") SetNodeInterface("")
} }
now, err := GetTime() now, seq, err := GetTime()
if err != nil { if err != nil {
return nil return nil
} }
@ -34,7 +34,7 @@ func NewUUID() UUID {
binary.BigEndian.PutUint32(uuid[0:], time_low) binary.BigEndian.PutUint32(uuid[0:], time_low)
binary.BigEndian.PutUint16(uuid[4:], time_mid) binary.BigEndian.PutUint16(uuid[4:], time_mid)
binary.BigEndian.PutUint16(uuid[6:], time_hi) binary.BigEndian.PutUint16(uuid[6:], time_hi)
binary.BigEndian.PutUint16(uuid[8:], clock_seq) binary.BigEndian.PutUint16(uuid[8:], seq)
copy(uuid[10:], nodeID) copy(uuid[10:], nodeID)
return uuid return uuid