Lint fixes
This commit is contained in:
parent
3fca70f112
commit
661043f5c8
@ -35,9 +35,13 @@ func (s *RPCServer) handleWS(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(500)
|
w.WriteHeader(500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer c.Close()
|
|
||||||
|
|
||||||
handleWsConn(r.Context(), c, s.methods, nil, nil)
|
handleWsConn(r.Context(), c, s.methods, nil, nil)
|
||||||
|
|
||||||
|
if err := c.Close(); err != nil {
|
||||||
|
log.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: return errors to clients per spec
|
// TODO: return errors to clients per spec
|
||||||
|
@ -137,11 +137,10 @@ func handleWsConn(ctx context.Context, conn *websocket.Conn, handler handlers, r
|
|||||||
nw := func(cb func(io.Writer)) {
|
nw := func(cb func(io.Writer)) {
|
||||||
cb(ioutil.Discard)
|
cb(ioutil.Discard)
|
||||||
}
|
}
|
||||||
done := func(){}
|
done := cf
|
||||||
if frame.ID != nil {
|
if frame.ID != nil {
|
||||||
nw = nextWriter
|
nw = nextWriter
|
||||||
|
|
||||||
|
|
||||||
handlingLk.Lock()
|
handlingLk.Lock()
|
||||||
handling[*frame.ID] = cf
|
handling[*frame.ID] = cf
|
||||||
handlingLk.Unlock()
|
handlingLk.Unlock()
|
||||||
@ -150,7 +149,6 @@ func handleWsConn(ctx context.Context, conn *websocket.Conn, handler handlers, r
|
|||||||
handlingLk.Lock()
|
handlingLk.Lock()
|
||||||
defer handlingLk.Unlock()
|
defer handlingLk.Unlock()
|
||||||
|
|
||||||
cf := handling[*frame.ID]
|
|
||||||
cf()
|
cf()
|
||||||
delete(handling, *frame.ID)
|
delete(handling, *frame.ID)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user