linting errors: afew more

This commit is contained in:
Zach Ramsay
2017-11-27 22:39:11 +00:00
committed by Ethan Buchman
parent 8f0237610e
commit 68e7983c70
12 changed files with 50 additions and 24 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ func (a ABCIApp) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error
c := a.App.CheckTx(tx)
// and this gets written in a background thread...
if c.IsOK() {
go func() { a.App.DeliverTx(tx) }()
go func() { a.App.DeliverTx(tx) }() // nolint (errcheck)
}
return &ctypes.ResultBroadcastTx{c.Code, c.Data, c.Log, tx.Hash()}, nil
}
@@ -58,7 +58,7 @@ func (a ABCIApp) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
c := a.App.CheckTx(tx)
// and this gets written in a background thread...
if c.IsOK() {
go func() { a.App.DeliverTx(tx) }()
go func() { a.App.DeliverTx(tx) }() // nolint (errcheck)
}
return &ctypes.ResultBroadcastTx{c.Code, c.Data, c.Log, tx.Hash()}, nil
}
+1 -1
View File
@@ -25,7 +25,7 @@ func StartGRPCServer(protoAddr string) (net.Listener, error) {
grpcServer := grpc.NewServer()
RegisterBroadcastAPIServer(grpcServer, &broadcastAPI{})
go grpcServer.Serve(ln)
go grpcServer.Serve(ln) // nolint (errcheck)
return ln, nil
}
+2 -2
View File
@@ -93,7 +93,7 @@ func (c *JSONRPCClient) Call(method string, params map[string]interface{}, resul
if err != nil {
return nil, err
}
defer httpResponse.Body.Close()
defer httpResponse.Body.Close() // nolint (errcheck)
responseBytes, err := ioutil.ReadAll(httpResponse.Body)
if err != nil {
@@ -129,7 +129,7 @@ func (c *URIClient) Call(method string, params map[string]interface{}, result in
if err != nil {
return nil, err
}
defer resp.Body.Close()
defer resp.Body.Close() // nolint (errcheck)
responseBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
+6 -2
View File
@@ -620,7 +620,9 @@ func (wsc *wsConnection) writeRoutine() {
pingTicker := time.NewTicker(wsc.pingPeriod)
defer func() {
pingTicker.Stop()
wsc.baseConn.Close()
if err := wsc.baseConn.Close(); err != nil {
wsc.Logger.Error("Error closing connection", "err", err)
}
}()
// https://github.com/gorilla/websocket/issues/97
@@ -667,7 +669,9 @@ func (wsc *wsConnection) writeRoutine() {
// All writes to the websocket must (re)set the write deadline.
// If some writes don't set it while others do, they may timeout incorrectly (https://github.com/tendermint/tendermint/issues/553)
func (wsc *wsConnection) writeMessageWithDeadline(msgType int, msg []byte) error {
wsc.baseConn.SetWriteDeadline(time.Now().Add(wsc.writeWait))
if err := wsc.baseConn.SetWriteDeadline(time.Now().Add(wsc.writeWait)); err != nil {
return err
}
return wsc.baseConn.WriteMessage(msgType, msg)
}