Skip to content

Commit 838719f

Browse files
remove func() from defer
Co-authored-by: Daniil Ankushin <[email protected]> Signed-off-by: Ng Wei Han <[email protected]>
1 parent c98c71b commit 838719f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

jsonrpc/websocket.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ func (ws *Websocket) ServeHTTP(w http.ResponseWriter, r *http.Request) {
7878
}
7979

8080
// Ensure we decrease the connection count when the connection closes
81-
defer func() {
82-
ws.connCount.Add(-1)
83-
}()
81+
defer ws.connCount.Add(-1)
8482

8583
// TODO include connection information, such as the remote address, in the logs.
8684

0 commit comments

Comments
 (0)