From 615ec82a55fb0a7444ea402a20067a43b1864c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=A1=D1=8B=D1=81?= =?UTF-8?q?=D0=BE=D0=B5=D0=B2?= Date: Mon, 30 Oct 2023 21:37:55 +0800 Subject: [PATCH] Makes linter happy --- pkg/ws/ws.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/ws/ws.go b/pkg/ws/ws.go index 84479be..131bfd2 100644 --- a/pkg/ws/ws.go +++ b/pkg/ws/ws.go @@ -106,8 +106,12 @@ func NewWS(url string, opts Options) (*Connection, error) { err = websocket.Message.Receive(ws, &msg) if err != nil { if opts.WaitForResp >= 0 { + // If we are waiting for single response and connection is closed + // we just return from the function return - } else if err.Error() == "EOF" { + } + + if err.Error() == "EOF" { color.New(color.FgRed).Println("Connection closed by the server") } else { color.New(color.FgRed).Println("Fail read from connection: ", err)