Merge pull request #259 from picatz/minor-refactors

Minor refactors using golint
This commit is contained in:
Simone Margaritelli 2018-05-02 10:21:11 +02:00 committed by GitHub
commit f35a8b98ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 71 additions and 102 deletions

View file

@ -20,14 +20,13 @@ func FindGateway(iface *Endpoint) (*Endpoint, error) {
return IPv4RouteIsGateway(iface.Name(), m, func(gateway string) (*Endpoint, error) {
if gateway == iface.IpAddress {
return iface, nil
} else {
// we have the address, now we need its mac
mac, err := ArpLookup(iface.Name(), gateway, false)
if err != nil {
return nil, err
}
return NewEndpoint(gateway, mac), nil
}
// we have the address, now we need its mac
mac, err := ArpLookup(iface.Name(), gateway, false)
if err != nil {
return nil, err
}
return NewEndpoint(gateway, mac), nil
})
}
}