Skip to content

Commit

Permalink
Adding returns when an error occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Dec 27, 2023
1 parent 8a7d4ab commit 2d4179b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/views/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (v *Views) Websocket(c echo.Context) error {
v.cache.Delete(responseTransporter.Server.String())
v.cache.Delete(responseTransporter.Server.String() + internalChannelNameAppend)
loop = false

Check failure on line 101 in server/views/websocket.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to loop (ineffassign)
return nil
}

_, msg, err = ws.ReadMessage()
Expand All @@ -109,6 +110,7 @@ func (v *Views) Websocket(c echo.Context) error {
v.cache.Delete(responseTransporter.Server.String())
v.cache.Delete(responseTransporter.Server.String() + internalChannelNameAppend)
loop = false

Check failure on line 112 in server/views/websocket.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to loop (ineffassign)
return nil
}
internalChannel <- msg
log.Printf("Message received from \"%s\": %s", responseTransporter.Server, msg)
Expand All @@ -121,6 +123,7 @@ func (v *Views) Websocket(c echo.Context) error {
v.cache.Delete(responseTransporter.Server.String())
v.cache.Delete(responseTransporter.Server.String() + internalChannelNameAppend)
loop = false

Check failure on line 125 in server/views/websocket.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to loop (ineffassign)
return nil
}
var msgType int
msgType, msg, err = ws.ReadMessage()
Expand All @@ -131,6 +134,7 @@ func (v *Views) Websocket(c echo.Context) error {
v.cache.Delete(responseTransporter.Server.String())
v.cache.Delete(responseTransporter.Server.String() + internalChannelNameAppend)
loop = false
return nil
}
}
}
Expand Down

0 comments on commit 2d4179b

Please sign in to comment.