fix new linting errors

This commit is contained in:
Zach Ramsay
2017-10-26 19:24:18 -04:00
committed by Ethan Buchman
parent 414a8cb0ba
commit 6f3c05545d
6 changed files with 32 additions and 27 deletions

View File

@ -97,7 +97,7 @@ metalinter_test: ensure_tools
--enable=varcheck \
./...
#--enable=aligncheck \
#--enable=maligned \
#--enable=dupl \
#--enable=errcheck \
#--enable=goconst \

View File

@ -272,7 +272,7 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) {
}
var nn int
var res *TimedWALMessage
var res *TimedWALMessage // nolint: gosimple
res = wire.ReadBinary(&TimedWALMessage{}, bytes.NewBuffer(data), int(length), &nn, &err).(*TimedWALMessage)
if err != nil {
return nil, fmt.Errorf("failed to decode data: %v", err)

View File

@ -34,7 +34,7 @@ const (
ValDir = "validators"
CheckDir = "checkpoints"
dirPerm = os.FileMode(0755)
filePerm = os.FileMode(0644)
//filePerm = os.FileMode(0644)
)
type provider struct {

View File

@ -216,8 +216,7 @@ func echoViaWS(cl *client.WSClient, val string) (string, error) {
return "", err
}
select {
case msg := <-cl.ResponsesCh:
msg := <-cl.ResponsesCh
if msg.Error != nil {
return "", err
@ -229,7 +228,6 @@ func echoViaWS(cl *client.WSClient, val string) (string, error) {
}
return result.Value, nil
}
}
func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
params := map[string]interface{}{
@ -240,8 +238,7 @@ func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
return []byte{}, err
}
select {
case msg := <-cl.ResponsesCh:
msg := <-cl.ResponsesCh
if msg.Error != nil {
return []byte{}, msg.Error
@ -253,7 +250,6 @@ func echoBytesViaWS(cl *client.WSClient, bytes []byte) ([]byte, error) {
}
return result.Value, nil
}
}
func testWithWSClient(t *testing.T, cl *client.WSClient) {
val := "acbd"
@ -333,6 +329,11 @@ func TestWSNewWSRPCFunc(t *testing.T) {
got := result.Value
assert.Equal(t, got, val)
}
result := new(ResultEcho)
err = json.Unmarshal(*msg.Result, result)
require.Nil(t, err)
got := result.Value
assert.Equal(t, got, val)
}
func TestWSHandlesArrayParams(t *testing.T) {
@ -358,6 +359,11 @@ func TestWSHandlesArrayParams(t *testing.T) {
got := result.Value
assert.Equal(t, got, val)
}
result := new(ResultEcho)
err = json.Unmarshal(*msg.Result, result)
require.Nil(t, err)
got := result.Value
assert.Equal(t, got, val)
}
// TestWSClientPingPong checks that a client & server exchange pings

View File

@ -11,7 +11,7 @@ type TxIndexer interface {
// AddBatch analyzes, indexes or stores a batch of transactions.
// NOTE: We do not specify Index method for analyzing a single transaction
// here because it bears heavy perfomance loses. Almost all advanced indexers
// here because it bears heavy performance losses. Almost all advanced indexers
// support batching.
AddBatch(b *Batch) error

View File

@ -10,7 +10,6 @@ import (
"github.com/tendermint/tendermint/state/txindex"
"github.com/tendermint/tendermint/types"
db "github.com/tendermint/tmlibs/db"
)
// TxIndex is the simplest possible indexer, backed by Key-Value storage (levelDB).