From 8f96b0e3e3ee47272377d1cafe0fa45758dab47f Mon Sep 17 00:00:00 2001 From: Kane York Date: Fri, 31 Jan 2020 21:22:28 -0800 Subject: [PATCH] Fix compile for new version of go-uuid --- socketserver/server/commands.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/socketserver/server/commands.go b/socketserver/server/commands.go index 8a8108be..564f80e0 100644 --- a/socketserver/server/commands.go +++ b/socketserver/server/commands.go @@ -139,13 +139,19 @@ func C2SHello(_ *websocket.Conn, client *ClientInfo, msg ClientMessage) (_ Clien if clientIDStr, ok := ary[1].(string); ok { clientID = uuid.FromStringOrNil(clientIDStr) if clientID == uuid.Nil { - clientID = uuid.NewV4() + clientID, err = uuid.NewV4() + if err != nil { + panic(err) // randomness should not fail + } } } else if _, ok := ary[1].(bool); ok { // opt out clientID = AnonymousClientID } else if ary[1] == nil { - clientID = uuid.NewV4() + clientID, err = uuid.NewV4() + if err != nil { + panic(err) // randomness should not fail + } } else { err = ErrExpectedTwoStrings return