From 115871aeb7b6d4ca21287a29e18eccc7837b29b4 Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Wed, 17 Aug 2022 22:40:39 +0200 Subject: [PATCH] fixed empty config file --- config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.go b/config.go index a3d81ed..b53a010 100644 --- a/config.go +++ b/config.go @@ -2,6 +2,8 @@ package main import ( "encoding/json" + "errors" + "io" "os" "path/filepath" "strings" @@ -41,6 +43,9 @@ func LoadConfig() error { cfg := &Config{} if err := json.NewDecoder(file).Decode(cfg); err != nil { + if errors.Is(err, io.EOF) { + return nil + } return err }