From 9cf118996d684b0f23a4fb689a3aa4fbcae2b11b Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sat, 16 Nov 2019 15:01:40 -0500 Subject: [PATCH] Support config.yml (as an alternative to config.yaml) --- config/config.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 03f7e133..40ec9f0d 100644 --- a/config/config.go +++ b/config/config.go @@ -5,6 +5,7 @@ import ( "github.com/TwinProduction/gatus/core" "gopkg.in/yaml.v2" "io/ioutil" + "os" "time" ) @@ -21,7 +22,14 @@ func Get() *Config { if config == nil { cfg, err := readConfigurationFile("config.yaml") if err != nil { - panic(err) + if os.IsNotExist(err) { + cfg, err = readConfigurationFile("config.yml") + if err != nil { + panic(err) + } + } else { + panic(err) + } } config = cfg }