From bc9132f84d5dbb37d06ff08be197b13619bf5dfb Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 6 Dec 2022 12:17:28 +0000 Subject: [PATCH] fix: remove config file requirement, fixes #435 --- config/config.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/config/config.go b/config/config.go index adc6f22..dd6fad3 100644 --- a/config/config.go +++ b/config/config.go @@ -8,7 +8,6 @@ import ( "github.com/robfig/cron/v3" "io/ioutil" "net/http" - "os" "regexp" "strconv" "strings" @@ -376,13 +375,6 @@ func readColors() map[string]map[string]string { return colors } -func mustReadConfigLocation() string { - if _, err := os.Stat(*cFlag); err != nil { - logbuch.Fatal("failed to find config file at '%s'", *cFlag) - } - return *cFlag -} - func resolveDbDialect(dbType string) string { if dbType == "cockroach" { return "postgres" @@ -409,7 +401,7 @@ func Load(version string) *Config { flag.Parse() - if err := configor.New(&configor.Config{}).Load(config, mustReadConfigLocation()); err != nil { + if err := configor.New(&configor.Config{}).Load(config, *cFlag); err != nil { logbuch.Fatal("failed to read config: %v", err) }