From 091d2c3e5ecb595f69d1f7273ed7c907c087c2c7 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 6 Nov 2018 13:12:42 +0100 Subject: [PATCH] openFile creates a file if not exist => ErrNotExist is not possible --- libs/autofile/autofile.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libs/autofile/autofile.go b/libs/autofile/autofile.go index 8e820d7d0..a1e2f49e6 100644 --- a/libs/autofile/autofile.go +++ b/libs/autofile/autofile.go @@ -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 } }