Make Close() method on Iterators return an error

This commit is contained in:
Andrew Dunham 2015-04-14 20:17:31 -07:00
parent 5c9979ec8b
commit 1b6395ed0a
19 changed files with 89 additions and 33 deletions

View file

@ -123,9 +123,19 @@ func (it *Not) NextPath() bool {
return false
}
func (it *Not) Close() {
it.primaryIt.Close()
it.allIt.Close()
// Close closes the primary and all iterators. If an error occurs, only the
// first one will be returned.
func (it *Not) Close() error {
var ret error
if err := it.primaryIt.Close(); err != nil && ret != nil {
ret = err
}
if err := it.allIt.Close(); err != nil && ret != nil {
ret = err
}
return ret
}
func (it *Not) Type() graph.Type { return graph.Not }