Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
fix 'file already closed' in Go 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
keks committed Oct 15, 2017
1 parent 80cbd2e commit 2538708
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion serialfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ func (f *serialFile) NextFile() (File, error) {
// if a file was opened previously, close it
err := f.Close()
if err != nil {
return nil, err
switch err2 := err.(type) {
case *os.PathError:
if err2.Err != os.ErrClosed {
return nil, err
}
default:
return nil, err
}
}

// if there aren't any files left in the root directory, we're done
Expand Down

0 comments on commit 2538708

Please sign in to comment.