From: James Mills <1290234+prologic@users.noreply.github.com> Date: Sun, 26 Mar 2023 14:46:09 +0000 (+1000) Subject: Fix tests and squelch warning if config file not found X-Git-Tag: 0.3.2~2 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=dfaa5cd49050f4cf13f632aa957929433e92205c;p=aya.git Fix tests and squelch warning if config file not found --- diff --git a/main.go b/main.go index 03aa1ba..3df8d58 100644 --- a/main.go +++ b/main.go @@ -709,7 +709,9 @@ func initConfig() { // If a config file is found, read it in. if err := viper.ReadInConfig(); err != nil { - log.WithError(err).Warnf("error reading config %s (using defaults)", viper.ConfigFileUsed()) + if _, ok := err.(viper.ConfigFileNotFoundError); !ok { + log.WithError(err).Warnf("error reading config %s (using defaults)", viper.ConfigFileUsed()) + } } } diff --git a/testdata/extensions/.test/index.html b/testdata/extensions/.test/index.html index ef8cfca..a25e79f 100644 --- a/testdata/extensions/.test/index.html +++ b/testdata/extensions/.test/index.html @@ -2,7 +2,7 @@
Hello World!
diff --git a/testdata/ignore/.test/index.html b/testdata/ignore/.test/index.html index 417c430..a237b11 100644 --- a/testdata/ignore/.test/index.html +++ b/testdata/ignore/.test/index.html @@ -1,5 +1,5 @@ -Simple page
diff --git a/testdata/simple/.test/index.html b/testdata/simple/.test/index.html index 417c430..a237b11 100644 --- a/testdata/simple/.test/index.html +++ b/testdata/simple/.test/index.html @@ -1,5 +1,5 @@ -Simple page
diff --git a/testdata/variables/.test/index.html b/testdata/variables/.test/index.html index 25dfc33..42d7892 100644 --- a/testdata/variables/.test/index.html +++ b/testdata/variables/.test/index.html @@ -2,7 +2,7 @@Simple page