]> Nishi Git Mirror - aya.git/commitdiff
Fix tests and squelch warning if config file not found
authorJames Mills <1290234+prologic@users.noreply.github.com>
Sun, 26 Mar 2023 14:46:09 +0000 (00:46 +1000)
committerJames Mills <1290234+prologic@users.noreply.github.com>
Sun, 26 Mar 2023 14:46:09 +0000 (00:46 +1000)
main.go
testdata/extensions/.test/index.html
testdata/ignore/.test/index.html
testdata/simple/.test/index.html
testdata/variables/.test/index.html

diff --git a/main.go b/main.go
index 03aa1ba9be69470111be5b21a4c1c7a8a275ae96..3df8d5838450d6b1dddf9dba12dfe5a0a2564d6e 100644 (file)
--- 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())
+               }
        }
 }
 
index ef8cfcaa9c64f3514dba0c8fd35c57932a6b5db9..a25e79fbaf6dab7c0c0bdf7206d99d3957db96df 100644 (file)
@@ -2,7 +2,7 @@
        <head>
                <title>Hello World</title>
        </head>
-       <body><h1 id="hello-world">Hello World <a class="anchor" href="#hello-world"></a></h1>
+       <body><h1 id="hello-world">Hello World <a class="anchor" href="#hello-world"> </a></h1>
 <p>Hello World!</p>
 </body>
 </html>
index 417c430bb28d9bbbec5e028f01675bd04ec7cb1f..a237b11034406f4b956d79fdeb6bf73837156dab 100644 (file)
@@ -1,5 +1,5 @@
 <html>
-       <body><h1 id="simple">Simple <a class="anchor" href="#simple"></a></h1>
+       <body><h1 id="simple">Simple <a class="anchor" href="#simple"> </a></h1>
 <p>Simple page</p>
 </body>
 </html>
index 417c430bb28d9bbbec5e028f01675bd04ec7cb1f..a237b11034406f4b956d79fdeb6bf73837156dab 100644 (file)
@@ -1,5 +1,5 @@
 <html>
-       <body><h1 id="simple">Simple <a class="anchor" href="#simple"></a></h1>
+       <body><h1 id="simple">Simple <a class="anchor" href="#simple"> </a></h1>
 <p>Simple page</p>
 </body>
 </html>
index 25dfc33bff8c7a7dde1f3ac945dd60bfc7996f9a..42d789297301b670a1c3bd2f3d55641312edfa16 100644 (file)
@@ -2,7 +2,7 @@
        <head>
                <title>Simple</title>
        </head>
-       <body><h1 id="simple">Simple <a class="anchor" href="#simple"></a></h1>
+       <body><h1 id="simple">Simple <a class="anchor" href="#simple"> </a></h1>
 <p>Simple page</p>
 </body>
 </html>