From cfa1efc7eb732b3f1d5ba1686f68ef8588ef9756 Mon Sep 17 00:00:00 2001 From: Jingguo Yao Date: Sun, 29 Apr 2018 11:28:43 +0800 Subject: [PATCH] contrib/raftexample: remove useless check `err == raftsnap.ErrNoSnapshot` being false implies that `err != raftsnap.ErrNoSnapshot` is true. --- contrib/raftexample/kvstore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/raftexample/kvstore.go b/contrib/raftexample/kvstore.go index d4df7b3c0..453e4a5ae 100644 --- a/contrib/raftexample/kvstore.go +++ b/contrib/raftexample/kvstore.go @@ -70,7 +70,7 @@ func (s *kvstore) readCommits(commitC <-chan *string, errorC <-chan error) { if err == raftsnap.ErrNoSnapshot { return } - if err != nil && err != raftsnap.ErrNoSnapshot { + if err != nil { log.Panic(err) } log.Printf("loading snapshot at term %d and index %d", snapshot.Metadata.Term, snapshot.Metadata.Index)