From 2d5b89eb1cb9aba31a04148964e96a8639e551fb Mon Sep 17 00:00:00 2001 From: xtrafrancyz Date: Fri, 15 Dec 2017 18:22:14 +0200 Subject: [PATCH] Fix creation of new database file --- backend/file.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/backend/file.go b/backend/file.go index e2c9444..602fbb4 100644 --- a/backend/file.go +++ b/backend/file.go @@ -31,15 +31,11 @@ func NewFile(slugLength int, path string) (*File, error) { } if _, err := os.Stat(backend.file); os.IsNotExist(err) { - file, err := os.Create(backend.file) - if err != nil { - return nil, err - } - file.Close() + backend.dirty = true + backend.cache = &sync.Map{} if err = backend.save(); err != nil { return nil, err } - backend.cache = &sync.Map{} } else { if err = backend.load(); err != nil { return nil, err