Skip to content

Commit

Permalink
Runs goimports on all Tendermint code
Browse files Browse the repository at this point in the history
As per conversation here: tendermint#3218 (comment)

This is the result of running the following code on the repo:

```bash
find . -name '*.go' | grep -v 'vendor/' | xargs -n 1 goimports -w
```
  • Loading branch information
thanethomson committed Jan 28, 2019
1 parent ff3c4bf commit a5cf0e4
Show file tree
Hide file tree
Showing 38 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion benchmarks/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"

proto "github.com/tendermint/tendermint/benchmarks/proto"
"github.com/tendermint/tendermint/crypto/ed25519"
Expand Down
2 changes: 1 addition & 1 deletion blockchain/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package blockchain

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/types"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/tendermint/commands/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package commands

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
)

Expand Down
8 changes: 4 additions & 4 deletions consensus/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/pkg/errors"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cstypes "github.com/tendermint/tendermint/consensus/types"
cmn "github.com/tendermint/tendermint/libs/common"
tmevents "github.com/tendermint/tendermint/libs/events"
Expand Down Expand Up @@ -438,9 +438,9 @@ func (conR *ConsensusReactor) broadcastHasVoteMessage(vote *types.Vote) {

func makeRoundStepMessage(rs *cstypes.RoundState) (nrsMsg *NewRoundStepMessage) {
nrsMsg = &NewRoundStepMessage{
Height: rs.Height,
Round: rs.Round,
Step: rs.Step,
Height: rs.Height,
Round: rs.Round,
Step: rs.Step,
SecondsSinceStartTime: int(time.Since(rs.StartTime).Seconds()),
LastCommitRound: rs.LastCommit.Round(),
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/tendermint/tendermint/abci/client"
abcicli "github.com/tendermint/tendermint/abci/client"
"github.com/tendermint/tendermint/abci/example/kvstore"
abci "github.com/tendermint/tendermint/abci/types"
bc "github.com/tendermint/tendermint/blockchain"
Expand Down
1 change: 1 addition & 0 deletions consensus/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"hash/crc32"
"io"
"reflect"

//"strconv"
//"strings"
"time"
Expand Down
2 changes: 1 addition & 1 deletion consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type ConsensusState struct {
// internal state
mtx sync.RWMutex
cstypes.RoundState
state sm.State // State until height-1.
state sm.State // State until height-1.

// state changes may be triggered by: msgs from peers,
// msgs from ourself, or by timeouts
Expand Down
2 changes: 1 addition & 1 deletion consensus/types/round_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package types
import (
"testing"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/crypto/ed25519"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/types"
Expand Down
1 change: 1 addition & 0 deletions consensus/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"os"
"path/filepath"

// "sync"
"testing"
"time"
Expand Down
2 changes: 1 addition & 1 deletion consensus/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package consensus

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/types"
)

Expand Down
2 changes: 1 addition & 1 deletion crypto/merkle/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cmn "github.com/tendermint/tendermint/libs/common"
)

Expand Down
2 changes: 1 addition & 1 deletion crypto/merkle/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package merkle

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
)

var cdc *amino.Codec
Expand Down
2 changes: 1 addition & 1 deletion evidence/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package evidence

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
"github.com/tendermint/tendermint/types"
)
Expand Down
2 changes: 1 addition & 1 deletion mempool/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mempool

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
)

var cdc = amino.NewCodec()
Expand Down
2 changes: 1 addition & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
rpccore "github.com/tendermint/tendermint/rpc/core"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
grpccore "github.com/tendermint/tendermint/rpc/grpc"
"github.com/tendermint/tendermint/rpc/lib/server"
rpcserver "github.com/tendermint/tendermint/rpc/lib/server"
sm "github.com/tendermint/tendermint/state"
"github.com/tendermint/tendermint/state/txindex"
"github.com/tendermint/tendermint/state/txindex/kv"
Expand Down
2 changes: 1 addition & 1 deletion p2p/conn/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package conn

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
)

Expand Down
2 changes: 1 addition & 1 deletion p2p/pex/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package pex

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
)

var cdc *amino.Codec = amino.NewCodec()
Expand Down
2 changes: 1 addition & 1 deletion p2p/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package p2p

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
)

Expand Down
2 changes: 1 addition & 1 deletion privval/remote_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/pkg/errors"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/crypto"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/types"
Expand Down
2 changes: 1 addition & 1 deletion privval/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package privval

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
)

Expand Down
2 changes: 1 addition & 1 deletion rpc/client/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
abci "github.com/tendermint/tendermint/abci/types"

"github.com/tendermint/tendermint/rpc/client"
"github.com/tendermint/tendermint/rpc/test"
rpctest "github.com/tendermint/tendermint/rpc/test"
"github.com/tendermint/tendermint/types"
)

Expand Down
2 changes: 1 addition & 1 deletion rpc/core/types/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package core_types

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/types"
)

Expand Down
4 changes: 2 additions & 2 deletions rpc/grpc/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/require"

"github.com/tendermint/tendermint/abci/example/kvstore"
"github.com/tendermint/tendermint/rpc/grpc"
"github.com/tendermint/tendermint/rpc/test"
core_grpc "github.com/tendermint/tendermint/rpc/grpc"
rpctest "github.com/tendermint/tendermint/rpc/test"
)

func TestMain(m *testing.M) {
Expand Down
3 changes: 1 addition & 2 deletions rpc/lib/client/args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
)

type Tx []byte
Expand Down
2 changes: 1 addition & 1 deletion rpc/lib/client/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"

"github.com/pkg/errors"
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"

types "github.com/tendermint/tendermint/rpc/lib/types"
)
Expand Down
2 changes: 1 addition & 1 deletion rpc/lib/client/ws_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/pkg/errors"
metrics "github.com/rcrowley/go-metrics"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cmn "github.com/tendermint/tendermint/libs/common"
types "github.com/tendermint/tendermint/rpc/lib/types"
)
Expand Down
2 changes: 1 addition & 1 deletion rpc/lib/types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
)

type SampleResult struct {
Expand Down
2 changes: 1 addition & 1 deletion scripts/json2wal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"os"
"strings"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cs "github.com/tendermint/tendermint/consensus"
"github.com/tendermint/tendermint/types"
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/wal2json/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"io"
"os"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cs "github.com/tendermint/tendermint/consensus"
"github.com/tendermint/tendermint/types"
)
Expand Down
2 changes: 1 addition & 1 deletion state/txindex/kv/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kv

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
)

var cdc = amino.NewCodec()
Expand Down
2 changes: 1 addition & 1 deletion state/wire.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package state

import (
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
)

Expand Down
2 changes: 1 addition & 1 deletion tools/tm-monitor/mock/eventmeter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
stdlog "log"
"reflect"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/libs/log"
em "github.com/tendermint/tendermint/tools/tm-monitor/eventmeter"
)
Expand Down
2 changes: 1 addition & 1 deletion tools/tm-monitor/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewMonitor(options ...func(*Monitor)) *Monitor {
nodeQuit: make(map[string]chan struct{}),
recalculateNetworkUptimeEvery: 10 * time.Second,
numValidatorsUpdateInterval: 5 * time.Second,
logger: log.NewNopLogger(),
logger: log.NewNopLogger(),
}

for _, option := range options {
Expand Down
2 changes: 1 addition & 1 deletion tools/tm-monitor/monitor/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/crypto/ed25519"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
mock "github.com/tendermint/tendermint/tools/tm-monitor/mock"
Expand Down
12 changes: 6 additions & 6 deletions tools/tm-monitor/monitor/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func NewNode(rpcAddr string, options ...func(*Node)) *Node {

func NewNodeWithEventMeterAndRpcClient(rpcAddr string, em eventMeter, rpcClient rpc_client.HTTPClient, options ...func(*Node)) *Node {
n := &Node{
rpcAddr: rpcAddr,
em: em,
rpcClient: rpcClient,
Name: rpcAddr,
quit: make(chan struct{}),
rpcAddr: rpcAddr,
em: em,
rpcClient: rpcClient,
Name: rpcAddr,
quit: make(chan struct{}),
checkIsValidatorInterval: 5 * time.Second,
logger: log.NewNopLogger(),
logger: log.NewNopLogger(),
}

for _, option := range options {
Expand Down
3 changes: 1 addition & 2 deletions types/protobuf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import (
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"

"github.com/tendermint/go-amino"

amino "github.com/tendermint/go-amino"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
Expand Down
2 changes: 1 addition & 1 deletion types/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"fmt"

"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/merkle"
Expand Down
2 changes: 1 addition & 1 deletion types/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package types

import (
amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/crypto/encoding/amino"
cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino"
)

var cdc = amino.NewCodec()
Expand Down

0 comments on commit a5cf0e4

Please sign in to comment.