diff --git a/engine/MsgLogging.go b/engine/MsgLogging.go index 958bcaedf5..98075892c5 100644 --- a/engine/MsgLogging.go +++ b/engine/MsgLogging.go @@ -25,16 +25,16 @@ type msglist struct { } type MsgLog struct { - Enable bool - sem sync.Mutex - MsgList []*msglist - Last interfaces.Timestamp - all bool - nodeCnt int - - start interfaces.Timestamp - msgCnt int - msgPerSec int + Enable bool + sem sync.Mutex + MsgList []*msglist + Last interfaces.Timestamp + all bool + nodeCnt int + + start interfaces.Timestamp + msgCnt int + msgPerSec int // The last period (msg rate over the last period, so msg changes can be seen) Period int64 diff --git a/engine/MsgLogging_test.go b/engine/MsgLogging_test.go index c07f805008..034eb0eef6 100644 --- a/engine/MsgLogging_test.go +++ b/engine/MsgLogging_test.go @@ -2,17 +2,14 @@ package engine_test import ( "testing" + "time" - . "github.com/FactomProject/factomd/engine" - "github.com/FactomProject/factomd/state" "github.com/FactomProject/factomd/common/messages" "github.com/FactomProject/factomd/common/primitives" - - "time" + . "github.com/FactomProject/factomd/engine" + "github.com/FactomProject/factomd/state" ) - - func TestMessageLoging(t *testing.T) { msgLog := new(MsgLog) msgLog.Init(true, 0) @@ -29,20 +26,20 @@ func TestMessageLoging(t *testing.T) { msgLog.PrtMsgs(s) - msgLog.Add2(fnode, true, "peer","where",true,msg) - msgLog.Add2(fnode, false, "peer","where",true,msg) + msgLog.Add2(fnode, true, "peer", "where", true, msg) + msgLog.Add2(fnode, false, "peer", "where", true, msg) msgLog.Startp = primitives.NewTimestampFromMilliseconds(0) - msgLog.Add2(fnode, false, "peer","where",true,msg) + msgLog.Add2(fnode, false, "peer", "where", true, msg) if len(msgLog.MsgList) != 3 { t.Error("Should have three entries") } msgLog.PrtMsgs(s) - - msgLog.Last.SetTimeSeconds(msgLog.Last.GetTimeSeconds()-6) - time.Sleep(10*time.Millisecond) - msgLog.Add2(fnode, false, "peer","where",true,msg) + + msgLog.Last.SetTimeSeconds(msgLog.Last.GetTimeSeconds() - 6) + time.Sleep(10 * time.Millisecond) + msgLog.Add2(fnode, false, "peer", "where", true, msg) if len(msgLog.MsgList) != 0 { t.Error("Should have zero messages") diff --git a/state/stateConsensus_test.go b/state/stateConsensus_test.go index bdc8e6c421..ab1a9b2dc9 100644 --- a/state/stateConsensus_test.go +++ b/state/stateConsensus_test.go @@ -4,9 +4,4 @@ package state_test -import ( - -) - - - +import ()