This commit is contained in:
crusader 2017-12-02 00:43:09 +09:00
parent 2f57a0975f
commit f53c8f4117
2 changed files with 3 additions and 3 deletions

View File

@ -5,11 +5,11 @@ import (
"os/exec"
)
func DiscoverGateway() (net.IP, string, error) {
func DiscoverGateway() (ip net.IP, iface string, err error) {
routeCmd := exec.Command("netstat", "-rn")
output, err := routeCmd.CombinedOutput()
if err != nil {
return nil, err
return nil, "", err
}
return parseDarwinRouteGet(output)

View File

@ -9,7 +9,7 @@ func DiscoverGateway() (ip net.IP, iface string, err error) {
routeCmd := exec.Command("netstat", "-rn")
output, err := routeCmd.CombinedOutput()
if err != nil {
return nil, err
return nil, "", err
}
return parseBSDSolarisNetstat(output)