chore: enable early-return and superfluous-else from revive (#7129)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2025-06-05 09:10:58 +02:00
committed by GitHub
parent ddb74cdcf4
commit 186e4a1dbb
8 changed files with 115 additions and 52 deletions

View File

@@ -118,11 +118,10 @@ func autoParse(c *caddy.Controller) (Auto, error) {
}
_, err := os.Stat(a.directory)
if err != nil {
if os.IsNotExist(err) {
log.Warningf("Directory does not exist: %s", a.directory)
} else {
if !os.IsNotExist(err) {
return a, c.Errf("Unable to access root path '%s': %v", a.directory, err)
}
log.Warningf("Directory does not exist: %s", a.directory)
}
// regexp template