mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
chore: enable early-return and superfluous-else from revive (#7129)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -96,11 +96,10 @@ func hostsParse(c *caddy.Controller) (Hosts, error) {
|
||||
}
|
||||
s, err := os.Stat(h.path)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
log.Warningf("File does not exist: %s", h.path)
|
||||
} else {
|
||||
if !os.IsNotExist(err) {
|
||||
return h, c.Errf("unable to access hosts file '%s': %v", h.path, err)
|
||||
}
|
||||
log.Warningf("File does not exist: %s", h.path)
|
||||
}
|
||||
if s != nil && s.IsDir() {
|
||||
log.Warningf("Hosts file %q is a directory", h.path)
|
||||
|
||||
Reference in New Issue
Block a user