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

@ -181,9 +181,17 @@ func (it *LinksTo) Result() graph.Value {
}
// Close our subiterators.
func (it *LinksTo) Close() {
it.nextIt.Close()
it.primaryIt.Close()
func (it *LinksTo) Close() error {
var ret error
if err := it.nextIt.Close(); err != nil && ret != nil {
ret = err
}
if err := it.primaryIt.Close(); err != nil && ret != nil {
ret = err
}
return ret
}
// We won't ever have a new result, but our subiterators might.