From 081e650671126619460241975e7e26a588705799 Mon Sep 17 00:00:00 2001 From: Woosang Son Date: Mon, 2 Nov 2020 16:43:59 +0900 Subject: [PATCH] fix: fmt error --- p2p/switch_test.go | 22 +++++++++++----------- privval/signer_listener_endpoint_test.go | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/p2p/switch_test.go b/p2p/switch_test.go index 0e4a09e57..1d4fa9b85 100644 --- a/p2p/switch_test.go +++ b/p2p/switch_test.go @@ -790,12 +790,12 @@ func (book *addrBookMock) Save() {} type NormalReactor struct { BaseReactor channels []*conn.ChannelDescriptor - msgChan chan []byte + msgChan chan []byte } func NewNormalReactor(channels []*conn.ChannelDescriptor, async bool, recvBufSize int) *NormalReactor { nr := &NormalReactor{ - channels: channels, + channels: channels, } nr.BaseReactor = *NewBaseReactor("NormalReactor", nr, async, recvBufSize) nr.msgChan = make(chan []byte) @@ -823,7 +823,7 @@ type BlockedReactor struct { func NewBlockedReactor(channels []*conn.ChannelDescriptor, async bool, recvBufSize int) *BlockedReactor { br := &BlockedReactor{ - channels: channels, + channels: channels, } br.BaseReactor = *NewBaseReactor("BlockedReactor", br, async, recvBufSize) br.waitChan = make(chan int, 1) @@ -844,7 +844,7 @@ func (br *BlockedReactor) Receive(chID byte, peer Peer, msgBytes []byte) { } const ( - reactorNameNormal = "normal" + reactorNameNormal = "normal" reactorNameBlocked = "blocked" ) @@ -856,14 +856,14 @@ func TestSyncReactor(t *testing.T) { normalReactor := s2.Reactor(reactorNameNormal).(*NormalReactor) blockedReactor := s2.Reactor(reactorNameBlocked).(*BlockedReactor) - s1.Broadcast(0x01, []byte{1}) // the message for blocked reactor is first + s1.Broadcast(0x01, []byte{1}) // the message for blocked reactor is first time.Sleep(time.Millisecond * 200) // to make order among messages - s1.Broadcast(0x00, []byte{0}) // and then second message is for normal reactor + s1.Broadcast(0x00, []byte{0}) // and then second message is for normal reactor select { case <-normalReactor.msgChan: assert.Fail(t, "blocked reactor is not blocked") - case <- time.After(time.Second * 1): + case <-time.After(time.Second * 1): assert.True(t, true, "blocked reactor is blocked: OK") } @@ -881,14 +881,14 @@ func TestAsyncReactor(t *testing.T) { defer s2.Stop() normalReactor := s2.Reactor(reactorNameNormal).(*NormalReactor) - s1.Broadcast(0x01, []byte{1}) // the message for blocked reactor is first + s1.Broadcast(0x01, []byte{1}) // the message for blocked reactor is first time.Sleep(time.Millisecond * 200) // to make order among messages - s1.Broadcast(0x00, []byte{0}) // and then second message is for normal reactor + s1.Broadcast(0x00, []byte{0}) // and then second message is for normal reactor select { case msg := <-normalReactor.msgChan: assert.True(t, bytes.Equal(msg, []byte{0})) - case <- time.After(time.Second * 1): + case <-time.After(time.Second * 1): assert.Fail(t, "blocked reactor is blocked") } } @@ -909,4 +909,4 @@ func getInitSwitchFunc(bufSize int) func(int, *Switch, *config.P2PConfig) *Switc return sw } -} \ No newline at end of file +} diff --git a/privval/signer_listener_endpoint_test.go b/privval/signer_listener_endpoint_test.go index bc0ae1a1c..6eb4d7321 100644 --- a/privval/signer_listener_endpoint_test.go +++ b/privval/signer_listener_endpoint_test.go @@ -19,7 +19,7 @@ var ( testTimeoutAccept = defaultTimeoutAcceptSeconds * time.Second testTimeoutReadWrite = 1000 * time.Millisecond // increase timeout for slow test env - testTimeoutReadWrite2o3 = 60 * time.Millisecond // 2/3 of the other one + testTimeoutReadWrite2o3 = 60 * time.Millisecond // 2/3 of the other one ) type dialerTestCase struct {