From 0355b89f54e71dbe3807ed47753fb0ef7074aa46 Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Wed, 15 Apr 2015 11:46:26 -0700 Subject: [PATCH] Don't save non-errors in the memstore iterator As per the following link, io.EOF is returned to signal "no more items". Thus, we don't treat this as an error, and don't save it. https://godoc.org/github.com/cznic/b#Enumerator --- graph/memstore/iterator.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/graph/memstore/iterator.go b/graph/memstore/iterator.go index 17bd8e2..b39b4bf 100644 --- a/graph/memstore/iterator.go +++ b/graph/memstore/iterator.go @@ -15,6 +15,7 @@ package memstore import ( + "io" "math" "github.com/google/cayley/graph" @@ -121,7 +122,9 @@ func (it *Iterator) Next() bool { } result, _, err := it.iter.Next() if err != nil { - it.err = err + if err != io.EOF { + it.err = err + } return graph.NextLogOut(it, nil, false) } if !it.checkValid(result) {