mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 17:53:21 -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:
@@ -23,15 +23,14 @@ func TransferIn(c *caddy.Controller) (froms []string, err error) {
|
||||
return nil, c.ArgErr()
|
||||
}
|
||||
for i := range froms {
|
||||
if froms[i] != "*" {
|
||||
normalized, err := HostPort(froms[i], transport.Port)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
froms[i] = normalized
|
||||
} else {
|
||||
if froms[i] == "*" {
|
||||
return nil, fmt.Errorf("can't use '*' in transfer from")
|
||||
}
|
||||
normalized, err := HostPort(froms[i], transport.Port)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
froms[i] = normalized
|
||||
}
|
||||
}
|
||||
return froms, nil
|
||||
|
||||
Reference in New Issue
Block a user