all: use single uuid package

Internally, "pborman/uuid.NewUUID()" is calling "google/uuid.New()"
that return nil when there is an error [1].

Both package use the same license.

[1] https://github.com/pborman/uuid/blob/master/version1.go#L17
This commit is contained in:
Shulhan 2018-11-21 17:29:48 +07:00 committed by Vasiliy Tolstov
parent c845b3bd68
commit e5be708288

View File

@ -8,12 +8,12 @@ import (
"sync" "sync"
"time" "time"
"github.com/google/uuid"
"github.com/hashicorp/memberlist" "github.com/hashicorp/memberlist"
"github.com/micro/go-log" "github.com/micro/go-log"
"github.com/micro/go-micro/cmd" "github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/registry" "github.com/micro/go-micro/registry"
"github.com/mitchellh/hashstructure" "github.com/mitchellh/hashstructure"
"github.com/pborman/uuid"
) )
type action int type action int
@ -106,7 +106,7 @@ func configure(g *gossipRegistry, opts ...registry.Option) error {
c := memberlist.DefaultLocalConfig() c := memberlist.DefaultLocalConfig()
c.BindPort = 0 c.BindPort = 0
c.Name = hostname + "-" + uuid.NewUUID().String() c.Name = hostname + "-" + uuid.New().String()
c.Delegate = &delegate{ c.Delegate = &delegate{
updates: g.updates, updates: g.updates,
broadcasts: broadcasts, broadcasts: broadcasts,
@ -315,7 +315,7 @@ func (m *gossipRegistry) subscribe() (chan *registry.Result, chan bool) {
next := make(chan *registry.Result, 10) next := make(chan *registry.Result, 10)
exit := make(chan bool) exit := make(chan bool)
id := uuid.NewUUID().String() id := uuid.New().String()
m.s.Lock() m.s.Lock()
m.subs[id] = next m.subs[id] = next