From 0c5d1d5641a528666b3b47a9033d809869fdeb87 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Fri, 9 Dec 2016 13:10:54 -0800 Subject: [PATCH] raft: simplify boolean comparison, remove unused --- raft/raft_test.go | 10 ---------- raft/rawnode_test.go | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/raft/raft_test.go b/raft/raft_test.go index 7e2e48434..371bc24ce 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -1321,10 +1321,6 @@ func TestRecvMsgVote(t *testing.T) { testRecvMsgVote(t, pb.MsgVote) } -func testRecvMsgPreVote(t *testing.T) { - testRecvMsgVote(t, pb.MsgPreVote) -} - func testRecvMsgVote(t *testing.T, msgType pb.MessageType) { tests := []struct { state StateType @@ -2925,12 +2921,6 @@ func TestTransferNonMember(t *testing.T) { } } -// ents creates a raft state machine with a sequence of log entries at -// the given terms. -func ents(terms ...uint64) *raft { - return entsWithConfig(nil, terms...) -} - func entsWithConfig(configFunc func(*Config), terms ...uint64) *raft { storage := NewMemoryStorage() for i, term := range terms { diff --git a/raft/rawnode_test.go b/raft/rawnode_test.go index 6e98663ba..7b3683058 100644 --- a/raft/rawnode_test.go +++ b/raft/rawnode_test.go @@ -128,7 +128,7 @@ func TestRawNodeReadIndex(t *testing.T) { rawNode.raft.readStates = wrs // ensure the ReadStates can be read out hasReady := rawNode.HasReady() - if hasReady != true { + if !hasReady { t.Errorf("HasReady() returns %t, want %t", hasReady, true) } rd := rawNode.Ready()