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

This commit is contained in:
Anton Kaliaev
2018-11-09 16:29:43 +01:00
parent d178ea9eaf
commit 091d2c3e5e
+1 -5
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
}
}