Skip to content

Commit

Permalink
lib/util: Update UUID vendor
Browse files Browse the repository at this point in the history
It appears github.com/satori/go.uuid is functionally deprecated,
and has been superceded by github.com/gofrs/uuid.

- satori/go.uuid#84
- satori/go.uuid#90

This came to my attention because of un-tagged changes to
satori/go.uuid that changed the signature of uuid.NewV4()
from a single return val to two, resulting in:

$ go get github.com/Jeffail/leaps/cmd/...
warning: ignoring symlink /Users/ia/go/src/github.com/Jeffail/leaps/cmd/leaps/www
warning: ignoring symlink /Users/ia/go/src/github.com/Jeffail/leaps/cmd/leaps/www
# github.com/Jeffail/leaps/lib/util
go/src/github.com/Jeffail/leaps/lib/util/uuid_gen.go:51:19: multiple-value uuid.NewV4() in single-value context

Of course running 'dep ensure' fixed this issue, but
it seems like this project should use the 'longer fork'
of this dependency in any case.

This change does NOT address the 'what to do with the
error value' question; it just ignores the possible error.
  • Loading branch information
whilei committed Dec 22, 2018
1 parent 42a4cb0 commit 18a0176
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 10 deletions.
70 changes: 64 additions & 6 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
name = "github.com/lib/pq"

[[constraint]]
name = "github.com/satori/go.uuid"
version = "1.2.0"
name = "github.com/gofrs/uuid"
version = "3.1.2"

[[constraint]]
name = "gopkg.in/alexcesaro/statsd.v2"
Expand Down
5 changes: 3 additions & 2 deletions lib/util/uuid_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"fmt"
"time"

"github.com/satori/go.uuid"
"github.com/gofrs/uuid"
)

/*--------------------------------------------------------------------------------------------------
Expand All @@ -48,7 +48,8 @@ func GenerateStampedUUID() string {
GenerateUUID - Generates a UUID and returns it as a hex encoded string.
*/
func GenerateUUID() string {
return uuid.NewV4().String()
u, _ := uuid.NewV4()
return u.String()
}

/*--------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 18a0176

Please sign in to comment.