Print log message

This commit is contained in:
Kenjiro Nakayama 2023-11-14 14:35:25 +09:00
parent 1265f14cac
commit 6db907caed
1 changed files with 4 additions and 1 deletions

View File

@ -1158,7 +1158,10 @@ func (c *Conn) SetCloseHandler(h func(code int, text string) error) {
if h == nil {
h = func(code int, text string) error {
message := FormatCloseMessage(code, "")
_ = c.WriteControl(CloseMessage, message, time.Now().Add(writeWait))
err := c.WriteControl(CloseMessage, message, time.Now().Add(writeWait))
if err != nil {
log.Printf("websocket: discarding close handler error: %v", err)
}
return nil
}
}