Make Close() method on Iterators return an error
This commit is contained in:
parent
5c9979ec8b
commit
1b6395ed0a
19 changed files with 89 additions and 33 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue