diff options
Diffstat (limited to 'file.go')
-rw-r--r-- | file.go | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -75,13 +75,12 @@ func (iter *FileIter) Next() (*File, error) { // ForEach call the cb function for each file contained on this iter until // an error happends or the end of the iter is reached. If core.ErrStop is sent -// the iteration is stop but no error is returned +// the iteration is stop but no error is returned. The iterator is closed. func (iter *FileIter) ForEach(cb func(*File) error) error { - i := &FileIter{w: *NewTreeWalker(iter.w.r, iter.w.t)} - defer i.Close() + defer iter.Close() for { - f, err := i.Next() + f, err := iter.Next() if err != nil { if err == io.EOF { return nil |