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

@@ -26,13 +26,12 @@ func setup(c *caddy.Controller) error {
// Check if root path exists
_, err := os.Stat(config.Root)
if err != nil {
if os.IsNotExist(err) {
// Allow this, because the folder might appear later.
// But make sure the user knows!
log.Warningf("Root path does not exist: %s", config.Root)
} else {
if !os.IsNotExist(err) {
return plugin.Error("root", c.Errf("unable to access root path '%s': %v", config.Root, err))
}
// Allow this, because the folder might appear later.
// But make sure the user knows!
log.Warningf("Root path does not exist: %s", config.Root)
}
return nil