From 5be690657146d6b64144747859e5b17837b885f1 Mon Sep 17 00:00:00 2001 From: kSpacer201 Date: Tue, 17 Apr 2018 16:31:25 +0800 Subject: [PATCH 1/3] Fix a error from generate uuid string fix a error : client.go:118:23: multiple-value uuid.NewV4() in single-value context --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 28489b95..5418e1ac 100644 --- a/client.go +++ b/client.go @@ -115,9 +115,10 @@ type client struct { // newClient creates new client connection. func newClient(ctx context.Context, n *Node, t transport) *client { + uuid, _ := uuid.NewV4() c := &client{ ctx: ctx, - uid: uuid.NewV4().String(), + uid: uuid.String(), node: n, transport: t, } From 2bca8b240d48443bbbe84567f96c1c45b28a768b Mon Sep 17 00:00:00 2001 From: kSpacer201 Date: Tue, 17 Apr 2018 16:33:22 +0800 Subject: [PATCH 2/3] fix uuid error in node.go --- node.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node.go b/node.go index 4876bcf2..23763176 100644 --- a/node.go +++ b/node.go @@ -59,7 +59,8 @@ type Node struct { // New creates Node, the only required argument is config. func New(c Config) *Node { - uid := uuid.NewV4().String() + uidObject, _ := uuid.NewV4() + uid := uidObject.String() n := &Node{ uid: uid, From a6723b13b1b2ffe5631a3356e54f61311c249742 Mon Sep 17 00:00:00 2001 From: kSpacer201 Date: Tue, 17 Apr 2018 16:35:25 +0800 Subject: [PATCH 3/3] rename uuid to uuidObject --- client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index 5418e1ac..cb11e523 100644 --- a/client.go +++ b/client.go @@ -115,10 +115,10 @@ type client struct { // newClient creates new client connection. func newClient(ctx context.Context, n *Node, t transport) *client { - uuid, _ := uuid.NewV4() + uuidObject, _ := uuid.NewV4() c := &client{ ctx: ctx, - uid: uuid.String(), + uid: uuidObject.String(), node: n, transport: t, }