From a16cc84e41602fa36ca2b9b373a105d9309d20a7 Mon Sep 17 00:00:00 2001 From: Edmund Huber Date: Sat, 6 Jun 2015 16:15:09 -0700 Subject: [PATCH] don't shadow the second error --- irc/websocket.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/irc/websocket.go b/irc/websocket.go index 6bf38f64..72a1c1c8 100644 --- a/irc/websocket.go +++ b/irc/websocket.go @@ -40,7 +40,8 @@ func (this WSContainer) Write(msg []byte) (int, error) { } func (this WSContainer) SetDeadline(t time.Time) error { - err := this.SetWriteDeadline(t) - err = this.SetReadDeadline(t) - return err + if err := this.SetWriteDeadline(t); err != nil { + return err + } + return this.SetReadDeadline(t) }