add staticcheck linting (#3828)

cleanup to add linter

    grpc change:
        https://godoc.org/google.golang.org/grpc#WithContextDialer
        https://godoc.org/google.golang.org/grpc#WithDialer
        grpc/grpc-go#2627
    prometheous change:
        due to UninstrumentedHandler, being deprecated in the future
    empty branch = empty if or else statement
        didn't delete them entirely but commented
        couldn't find a reason to have them
    could not replicate the issue #3406
        but if want to keep it commented then we should comment out the if statement as well
This commit is contained in:
Marko
2019-07-25 07:35:30 +02:00
committed by Anton Kaliaev
parent 3a1f876802
commit 98cb8c9783
26 changed files with 116 additions and 105 deletions

View File

@ -155,12 +155,14 @@ func TestMempoolRmBadTx(t *testing.T) {
// and the tx should get removed from the pool
err := assertMempool(cs.txNotifier).CheckTx(txBytes, func(r *abci.Response) {
if r.GetCheckTx().Code != code.CodeTypeBadNonce {
t.Fatalf("expected checktx to return bad nonce, got %v", r)
t.Errorf("expected checktx to return bad nonce, got %v", r)
return
}
checkTxRespCh <- struct{}{}
})
if err != nil {
t.Fatalf("Error after CheckTx: %v", err)
t.Errorf("Error after CheckTx: %v", err)
return
}
// check for the tx
@ -180,7 +182,8 @@ func TestMempoolRmBadTx(t *testing.T) {
case <-checkTxRespCh:
// success
case <-ticker:
t.Fatalf("Timed out waiting for tx to return")
t.Errorf("Timed out waiting for tx to return")
return
}
// Wait until the tx is removed
@ -189,7 +192,8 @@ func TestMempoolRmBadTx(t *testing.T) {
case <-emptyMempoolCh:
// success
case <-ticker:
t.Fatalf("Timed out waiting for tx to be removed")
t.Errorf("Timed out waiting for tx to be removed")
return
}
}