style: 错误的命名更正

This commit is contained in:
kercylan98 2023-08-24 11:55:44 +08:00
parent 08559d8225
commit 1558b2868d
1 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ func NewWebsocket(addr string) *Client {
type Websocket struct {
addr string
conn *websocket.Conn
clsoed bool
closed bool
}
func (slf *Websocket) Run(runState chan<- error, receive func(wst int, packet []byte)) {
@ -26,9 +26,9 @@ func (slf *Websocket) Run(runState chan<- error, receive func(wst int, packet []
return
}
slf.conn = ws
slf.clsoed = false
slf.closed = false
runState <- nil
for !slf.clsoed {
for !slf.closed {
messageType, packet, readErr := ws.ReadMessage()
if readErr != nil {
panic(readErr)
@ -45,7 +45,7 @@ func (slf *Websocket) Write(packet *Packet) error {
}
func (slf *Websocket) Close() {
slf.clsoed = true
slf.closed = true
}
func (slf *Websocket) GetServerAddr() string {