From 67fb60d95b49f83cdd02fe7bec01ca17431cc09c Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 12 Jul 2018 13:25:02 +0200 Subject: [PATCH] switch to google's uuid library --- .gx/post-install | 0 examples/multipro/echo.go | 4 ++-- examples/multipro/ping.go | 4 ++-- package.json | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 .gx/post-install diff --git a/.gx/post-install b/.gx/post-install new file mode 100644 index 00000000..e69de29b diff --git a/examples/multipro/echo.go b/examples/multipro/echo.go index 48403d7f..a3d39f8b 100644 --- a/examples/multipro/echo.go +++ b/examples/multipro/echo.go @@ -8,10 +8,10 @@ import ( inet "github.com/libp2p/go-libp2p-net" + uuid "github.com/google/uuid" "github.com/libp2p/go-libp2p-host" pb "github.com/libp2p/go-libp2p/examples/multipro/pb" protobufCodec "github.com/multiformats/go-multicodec/protobuf" - uuid "github.com/satori/go.uuid" ) // pattern: /protocol-name/request-or-response-message/version @@ -126,7 +126,7 @@ func (e *EchoProtocol) Echo(host host.Host) bool { // create message data req := &pb.EchoRequest{ - MessageData: e.node.NewMessageData(uuid.Must(uuid.NewV4()).String(), false), + MessageData: e.node.NewMessageData(uuid.New().String(), false), Message: fmt.Sprintf("Echo from %s", e.node.ID())} signature, err := e.node.signProtoMessage(req) diff --git a/examples/multipro/ping.go b/examples/multipro/ping.go index bcc63dc1..f342aa69 100644 --- a/examples/multipro/ping.go +++ b/examples/multipro/ping.go @@ -6,11 +6,11 @@ import ( "fmt" "log" + uuid "github.com/google/uuid" "github.com/libp2p/go-libp2p-host" inet "github.com/libp2p/go-libp2p-net" p2p "github.com/libp2p/go-libp2p/examples/multipro/pb" protobufCodec "github.com/multiformats/go-multicodec/protobuf" - uuid "github.com/satori/go.uuid" ) // pattern: /protocol-name/request-or-response-message/version @@ -116,7 +116,7 @@ func (p *PingProtocol) Ping(host host.Host) bool { log.Printf("%s: Sending ping to: %s....", p.node.ID(), host.ID()) // create message data - req := &p2p.PingRequest{MessageData: p.node.NewMessageData(uuid.Must(uuid.NewV4()).String(), false), + req := &p2p.PingRequest{MessageData: p.node.NewMessageData(uuid.New().String(), false), Message: fmt.Sprintf("Ping from %s", p.node.ID())} // sign the data diff --git a/package.json b/package.json index 439a7e24..74760290 100644 --- a/package.json +++ b/package.json @@ -208,12 +208,6 @@ "name": "go-multicodec", "version": "0.1.5" }, - { - "author": "satori", - "hash": "QmcBWojPoNh4qm7zvv4qiepvCnnc7ALS9qcp7TNwwxT1gT", - "name": "go.uuid", - "version": "1.1.0" - }, { "author": "whyrusleeping", "hash": "QmUTQ9rzQf52c4MU4ESFbTF8RaUKtQztcAp6ww8wF3ahxC", @@ -249,6 +243,12 @@ "hash": "QmbzWHWFpwCm7GDgrGyKnqUzh48PnRp86VD2Bb8wq6ZfDP", "name": "go-libp2p-transport-upgrader", "version": "0.1.4" + }, + { + "author": "google", + "hash": "QmSSeQqc5QeuefkaM6JFV5tSF9knLUkXKVhW1eYRiqe72W", + "name": "uuid", + "version": "0.1.0" } ], "gxVersion": "0.4.0",