From 71022f4b584c1c2a9d6fffd740b4321e4811f606 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sat, 12 Sep 2020 19:52:36 +0200 Subject: [PATCH] Remove ErrWriterDead, replace with ErrClientDead. --- webclient.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webclient.go b/webclient.go index c4dfe83..6a0c1d0 100644 --- a/webclient.go +++ b/webclient.go @@ -1177,8 +1177,7 @@ func clientWriter(conn *websocket.Conn, ch <-chan interface{}, done chan<- struc } } -var ErrWriterDead = errors.New("client writer died") -var ErrClientDead = errors.New("client dead") +var ErrClientDead = errors.New("client is dead") func (c *webClient) action(m interface{}) error { select { @@ -1194,7 +1193,7 @@ func (c *webClient) write(m clientMessage) error { case c.writeCh <- m: return nil case <-c.writerDone: - return ErrWriterDead + return ErrClientDead } } @@ -1203,7 +1202,7 @@ func (c *webClient) close(data []byte) error { case c.writeCh <- closeMessage{data}: return nil case <-c.writerDone: - return ErrWriterDead + return ErrClientDead } }