Skip to content

Commit

Permalink
style: 错误的命名更正
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Aug 24, 2023
1 parent 08559d8 commit 1558b28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/client/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 1558b28

Please sign in to comment.