Browse Source

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

pull/2799/head
Anton Kaliaev 6 years ago
parent
commit
091d2c3e5e
1 changed files with 1 additions and 5 deletions
  1. +1
    -5
      libs/autofile/autofile.go

+ 1
- 5
libs/autofile/autofile.go View File

@ -176,11 +176,7 @@ func (af *AutoFile) Size() (int64, error) {
defer af.mtx.Unlock() defer af.mtx.Unlock()
if af.file == nil { 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 return -1, err
} }
} }


Loading…
Cancel
Save