Skip to content

Commit

Permalink
lint: cleanup branch lint errors (#7238)
Browse files Browse the repository at this point in the history
  • Loading branch information
tychoish committed Nov 4, 2021
1 parent 8629d31 commit 003d15f
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Expand Up @@ -33,7 +33,7 @@ linters:
- staticcheck
- structcheck
- stylecheck
- typecheck
# - typecheck
- unconvert
# - unparam
- unused
Expand Down
1 change: 1 addition & 0 deletions crypto/secp256k1/secp256k1_nocgo.go
@@ -1,3 +1,4 @@
//go:build !libsecp256k1
// +build !libsecp256k1

package secp256k1
Expand Down
1 change: 1 addition & 0 deletions internal/consensus/wal_fuzz.go
@@ -1,3 +1,4 @@
//go:build gofuzz
// +build gofuzz

package consensus
Expand Down
1 change: 1 addition & 0 deletions internal/libs/sync/deadlock.go
@@ -1,3 +1,4 @@
//go:build deadlock
// +build deadlock

package sync
Expand Down
1 change: 1 addition & 0 deletions internal/libs/sync/sync.go
@@ -1,3 +1,4 @@
//go:build !deadlock
// +build !deadlock

package sync
Expand Down
2 changes: 1 addition & 1 deletion internal/mempool/ids.go
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/tendermint/tendermint/types"
)

// nolint: golint
// nolint: revive
// TODO: Rename type.
type MempoolIDs struct {
mtx tmsync.RWMutex
Expand Down
1 change: 1 addition & 0 deletions internal/p2p/conn/conn_go110.go
@@ -1,3 +1,4 @@
//go:build go1.10
// +build go1.10

package conn
Expand Down
1 change: 1 addition & 0 deletions internal/p2p/conn/conn_notgo110.go
@@ -1,3 +1,4 @@
//go:build !go1.10
// +build !go1.10

package conn
Expand Down
4 changes: 2 additions & 2 deletions internal/state/state.go
Expand Up @@ -195,8 +195,8 @@ func (state *State) ToProto() (*tmstate.State, error) {
return sm, nil
}

// StateFromProto takes a state proto message & returns the local state type
func StateFromProto(pb *tmstate.State) (*State, error) { //nolint:golint
// FromProto takes a state proto message & returns the local state type
func FromProto(pb *tmstate.State) (*State, error) { //nolint:golint
if pb == nil {
return nil, errors.New("nil State")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/state/state_test.go
Expand Up @@ -1081,7 +1081,7 @@ func TestStateProto(t *testing.T) {
assert.NoError(t, err, tt.testName)
}

smt, err := sm.StateFromProto(pbs)
smt, err := sm.FromProto(pbs)
if tt.expPass2 {
require.NoError(t, err, tt.testName)
require.Equal(t, tt.state, smt, tt.testName)
Expand Down
2 changes: 1 addition & 1 deletion internal/state/store.go
Expand Up @@ -130,7 +130,7 @@ func (store dbStore) loadState(key []byte) (state State, err error) {
%v\n`, err))
}

sm, err := StateFromProto(sp)
sm, err := FromProto(sp)
if err != nil {
return state, err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/state/validation_test.go
Expand Up @@ -270,7 +270,7 @@ func TestValidateBlockEvidence(t *testing.T) {
A block with too much evidence fails
*/
evidence := make([]types.Evidence, 0)
var currentBytes int64 = 0
var currentBytes int64
// more bytes than the maximum allowed for evidence
for currentBytes <= maxBytesEvidence {
newEv := types.NewMockDuplicateVoteEvidenceWithValidator(height, time.Now(),
Expand All @@ -290,7 +290,7 @@ func TestValidateBlockEvidence(t *testing.T) {
A good block with several pieces of good evidence passes
*/
evidence := make([]types.Evidence, 0)
var currentBytes int64 = 0
var currentBytes int64
// precisely the amount of allowed evidence
for {
newEv := types.NewMockDuplicateVoteEvidenceWithValidator(height, defaultEvidenceTime,
Expand Down
2 changes: 1 addition & 1 deletion internal/statesync/reactor.go
Expand Up @@ -734,7 +734,7 @@ func (r *Reactor) handleLightBlockMessage(envelope p2p.Envelope) error {
}

case *ssproto.LightBlockResponse:
var height int64 = 0
var height int64
if msg.LightBlock != nil {
height = msg.LightBlock.SignedHeader.Header.Height
}
Expand Down
4 changes: 2 additions & 2 deletions internal/store/store.go
Expand Up @@ -345,7 +345,7 @@ func (bs *BlockStore) pruneRange(
var (
err error
pruned uint64
totalPruned uint64 = 0
totalPruned uint64
)

batch := bs.db.NewBatch()
Expand Down Expand Up @@ -392,7 +392,7 @@ func (bs *BlockStore) batchDelete(
start, end []byte,
preDeletionHook func(key, value []byte, batch dbm.Batch) error,
) (uint64, []byte, error) {
var pruned uint64 = 0
var pruned uint64
iter, err := bs.db.Iterator(start, end)
if err != nil {
return pruned, start, err
Expand Down
2 changes: 1 addition & 1 deletion node/node_test.go
Expand Up @@ -257,7 +257,7 @@ func TestCreateProposalBlock(t *testing.T) {

// fill the evidence pool with more evidence
// than can fit in a block
var currentBytes int64 = 0
var currentBytes int64
for currentBytes <= maxEvidenceBytes {
ev := types.NewMockDuplicateVoteEvidenceWithValidator(height, time.Now(), privVals[0], "test-chain")
currentBytes += int64(len(ev.Bytes()))
Expand Down
1 change: 1 addition & 0 deletions rpc/jsonrpc/client/integration_test.go
@@ -1,3 +1,4 @@
//go:build release
// +build release

// The code in here is comprehensive as an integration
Expand Down
1 change: 1 addition & 0 deletions tools/tools.go
@@ -1,3 +1,4 @@
//go:build tools
// +build tools

// This file uses the recommended method for tracking developer tools in a go module.
Expand Down
10 changes: 5 additions & 5 deletions types/validation.go
Expand Up @@ -162,9 +162,9 @@ func verifyCommitBatch(
var (
val *Validator
valIdx int32
seenVals = make(map[int32]int, len(commit.Signatures))
batchSigIdxs = make([]int, 0, len(commit.Signatures))
talliedVotingPower int64 = 0
seenVals = make(map[int32]int, len(commit.Signatures))
batchSigIdxs = make([]int, 0, len(commit.Signatures))
talliedVotingPower int64
)
// attempt to create a batch verifier
bv, ok := batch.CreateBatchVerifier(vals.GetProposer().PubKey)
Expand Down Expand Up @@ -275,8 +275,8 @@ func verifyCommitSingle(
var (
val *Validator
valIdx int32
seenVals = make(map[int32]int, len(commit.Signatures))
talliedVotingPower int64 = 0
seenVals = make(map[int32]int, len(commit.Signatures))
talliedVotingPower int64
voteSignBytes []byte
)
for idx, commitSig := range commit.Signatures {
Expand Down

0 comments on commit 003d15f

Please sign in to comment.