mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-12 04:03:44 +08:00
代码规范过滤,移除冗余代码,替换掉不推荐的包
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package websocket
|
||||
|
||||
import (
|
||||
@@ -105,7 +104,7 @@ func (c *Client) write() {
|
||||
}()
|
||||
defer func() {
|
||||
clientManager.Unregister <- c
|
||||
c.Socket.Close()
|
||||
_ = c.Socket.Close()
|
||||
}()
|
||||
for {
|
||||
select {
|
||||
@@ -118,7 +117,7 @@ func (c *Client) write() {
|
||||
g.Log().Warningf(ctxManager, "client write message, user:%+v", c.User)
|
||||
return
|
||||
}
|
||||
c.Socket.WriteJSON(message)
|
||||
_ = c.Socket.WriteJSON(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,7 +146,6 @@ func (c *Client) Context() context.Context {
|
||||
// Heartbeat 心跳更新
|
||||
func (c *Client) Heartbeat(currentTime uint64) {
|
||||
c.HeartbeatTime = currentTime
|
||||
return
|
||||
}
|
||||
|
||||
// IsHeartbeatTimeout 心跳是否超时
|
||||
|
||||
Reference in New Issue
Block a user