diff --git a/Gopkg.lock b/Gopkg.lock index 5bd73c0f..ba7561b6 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -164,10 +164,10 @@ revision = "abc90934186a77966e2beeac62ed966aac0561d5" [[projects]] - branch = "v1.2.0" + branch = "master" name = "github.com/satori/go.uuid" packages = ["."] - revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3" + revision = "36e9d2ebbde5e3f13ab2e25625fd453271d6522e" [[projects]] branch = "master" diff --git a/Gopkg.toml b/Gopkg.toml index af31eeb5..c79c31a5 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -59,8 +59,8 @@ name = "github.com/ryanuber/columnize" [[constraint]] + branch = "master" name = "github.com/satori/go.uuid" - version = "1.2.0" [[constraint]] branch = "master" diff --git a/_examples/tutorial/url-shortener/factory.go b/_examples/tutorial/url-shortener/factory.go index 9b893970..78fe63a9 100644 --- a/_examples/tutorial/url-shortener/factory.go +++ b/_examples/tutorial/url-shortener/factory.go @@ -10,7 +10,8 @@ type Generator func() string // DefaultGenerator is the defautl url generator var DefaultGenerator = func() string { - return uuid.NewV4().String() + id, _ := uuid.NewV4() + return id.String() } // Factory is responsible to generate keys(short urls) diff --git a/core/errors/errors.go b/core/errors/errors.go index 56611fde..01c8c2cd 100644 --- a/core/errors/errors.go +++ b/core/errors/errors.go @@ -31,8 +31,9 @@ type Error struct { // New creates and returns an Error with a pre-defined user output message // all methods below that doesn't accept a pointer receiver because actually they are not changing the original message func New(errMsg string) Error { + uidv4, _ := uuid.NewV4() // skip error. return Error{ - ID: uuid.NewV4().String(), + ID: uidv4.String(), Message: Prefix + errMsg, } } diff --git a/sessions/config.go b/sessions/config.go index 29181d8f..d126e408 100644 --- a/sessions/config.go +++ b/sessions/config.go @@ -124,7 +124,7 @@ func (c Config) Validate() Config { if c.SessionIDGenerator == nil { c.SessionIDGenerator = func() string { - id := uuid.NewV4() + id, _ := uuid.NewV4() return id.String() } }