diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-05-07 15:02:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-05-08 08:52:31 +0900 |
commit | 11c1ce77f9b194733bdcabe1b4dc660fa35cabbd (patch) | |
tree | 9f359c2f2e3f2e30cfbfcd71a44a8e69ad482174 /pkg/server | |
parent | 7d2823d4c037caf39c7222632669210a4b6d1ed4 (diff) |
server: replace github.com/satori/go.uuid
satori/go.uuid broke the API without the major version updated. We
could work around this with the module feature but looks like there is
a better option, google/uuid, so let's replace it.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'pkg/server')
-rw-r--r-- | pkg/server/server.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/server/server.go b/pkg/server/server.go index 75921ec1..647843da 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -26,7 +26,7 @@ import ( "time" "github.com/eapache/channels" - uuid "github.com/satori/go.uuid" + uuid "github.com/google/uuid" log "github.com/sirupsen/logrus" "google.golang.org/grpc" @@ -1996,9 +1996,10 @@ func (s *BgpServer) AddPath(ctx context.Context, r *api.AddPathRequest) (*api.Ad if err != nil { return err } - id, _ := uuid.NewV4() - s.uuidMap[id] = pathTokey(path) - uuidBytes = id.Bytes() + if id, err := uuid.NewRandom(); err == nil { + s.uuidMap[id] = pathTokey(path) + uuidBytes, _ = id.MarshalBinary() + } return nil }, true) return &api.AddPathResponse{Uuid: uuidBytes}, err |