openFile creates a file if not exist => ErrNotExist is not possible

This commit is contained in:
Anton Kaliaev 2018-11-06 13:12:42 +01:00
parent d178ea9eaf
commit 091d2c3e5e
1 changed files with 1 additions and 5 deletions

View File

@ -176,11 +176,7 @@ func (af *AutoFile) Size() (int64, error) {
defer af.mtx.Unlock()
if af.file == nil {
err := af.openFile()
if err != nil {
if err == os.ErrNotExist {
return 0, nil
}
if err := af.openFile(); err != nil {
return -1, err
}
}