mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-06 16:58:11 +08:00
fix 'file already closed' in Go 1.9
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
parent
b6eb085067
commit
1a93abcd69
@ -60,7 +60,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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user