Browse Source

contrib/raftexample: remove useless check

`err == raftsnap.ErrNoSnapshot` being false implies that
`err != raftsnap.ErrNoSnapshot` is true.
Jingguo Yao 7 years ago
parent
commit
cfa1efc7eb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      contrib/raftexample/kvstore.go

+ 1 - 1
contrib/raftexample/kvstore.go

@@ -70,7 +70,7 @@ func (s *kvstore) readCommits(commitC <-chan *string, errorC <-chan error) {
 			if err == raftsnap.ErrNoSnapshot {
 			if err == raftsnap.ErrNoSnapshot {
 				return
 				return
 			}
 			}
-			if err != nil && err != raftsnap.ErrNoSnapshot {
+			if err != nil {
 				log.Panic(err)
 				log.Panic(err)
 			}
 			}
 			log.Printf("loading snapshot at term %d and index %d", snapshot.Metadata.Term, snapshot.Metadata.Index)
 			log.Printf("loading snapshot at term %d and index %d", snapshot.Metadata.Term, snapshot.Metadata.Index)