mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 13:05:09 +00:00
New lint version upgrade (#4056)
* New lint version upgrade - linter was upgraded Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * enable-a;; is deprecated * minor change * another try * some more changes * some more changes * reenable prealloc * add version till bot is fixed
This commit is contained in:
@@ -70,7 +70,6 @@ var (
|
||||
// objects
|
||||
pubKey crypto.PubKey
|
||||
genDoc *types.GenesisDoc // cache the genesis structure
|
||||
addrBook p2p.AddrBook
|
||||
txIndexer txindex.TxIndexer
|
||||
consensusReactor *consensus.ConsensusReactor
|
||||
eventBus *types.EventBus // thread safe
|
||||
@@ -117,10 +116,6 @@ func SetGenesisDoc(doc *types.GenesisDoc) {
|
||||
genDoc = doc
|
||||
}
|
||||
|
||||
func SetAddrBook(book p2p.AddrBook) {
|
||||
addrBook = book
|
||||
}
|
||||
|
||||
func SetProxyAppQuery(appConn proxy.AppConnQuery) {
|
||||
proxyAppQuery = appConn
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ const (
|
||||
|
||||
// WSClient is a WebSocket client. The methods of WSClient are safe for use by
|
||||
// multiple goroutines.
|
||||
type WSClient struct {
|
||||
type WSClient struct { // nolint: maligned
|
||||
conn *websocket.Conn
|
||||
cdc *amino.Codec
|
||||
|
||||
@@ -252,7 +252,7 @@ func (c *WSClient) dial() error {
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
}
|
||||
rHeader := http.Header{}
|
||||
conn, _, err := dialer.Dial(c.protocol+"://"+c.Address+c.Endpoint, rHeader)
|
||||
conn, _, err := dialer.Dial(c.protocol+"://"+c.Address+c.Endpoint, rHeader) // nolint:bodyclose
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ func TestRPCParams(t *testing.T) {
|
||||
t.Errorf("#%d: err reading body: %v", i, err)
|
||||
continue
|
||||
}
|
||||
res.Body.Close()
|
||||
|
||||
recv := new(types.RPCResponse)
|
||||
assert.Nil(t, json.Unmarshal(blob, recv), "#%d: expecting successful parsing of an RPCResponse:\nblob: %s", i, blob)
|
||||
@@ -125,6 +126,7 @@ func TestJSONRPCID(t *testing.T) {
|
||||
t.Errorf("#%d: err reading body: %v", i, err)
|
||||
continue
|
||||
}
|
||||
res.Body.Close()
|
||||
|
||||
recv := new(types.RPCResponse)
|
||||
err = json.Unmarshal(blob, recv)
|
||||
@@ -150,6 +152,7 @@ func TestRPCNotification(t *testing.T) {
|
||||
// Always expecting back a JSONRPCResponse
|
||||
require.True(t, statusOK(res.StatusCode), "should always return 2XX")
|
||||
blob, err := ioutil.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
require.Nil(t, err, "reading from the body should not give back an error")
|
||||
require.Equal(t, len(blob), 0, "a notification SHOULD NOT be responded to by the server")
|
||||
}
|
||||
@@ -189,6 +192,7 @@ func TestRPCNotificationInBatch(t *testing.T) {
|
||||
t.Errorf("#%d: err reading body: %v", i, err)
|
||||
continue
|
||||
}
|
||||
res.Body.Close()
|
||||
|
||||
var responses []types.RPCResponse
|
||||
// try to unmarshal an array first
|
||||
@@ -229,6 +233,7 @@ func TestUnknownRPCPath(t *testing.T) {
|
||||
|
||||
// Always expecting back a 404 error
|
||||
require.Equal(t, http.StatusNotFound, res.StatusCode, "should always return 404")
|
||||
res.Body.Close()
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -257,6 +262,7 @@ func TestWebsocketManagerHandler(t *testing.T) {
|
||||
err = c.ReadJSON(&resp)
|
||||
require.NoError(t, err)
|
||||
require.Nil(t, resp.Error)
|
||||
dialResp.Body.Close()
|
||||
}
|
||||
|
||||
func newWSServer() *httptest.Server {
|
||||
|
||||
Reference in New Issue
Block a user