diff --git a/Gopkg.toml b/Gopkg.toml index 24f0f17..d7072c2 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,6 +1,6 @@ # Gopkg.toml example # -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html # for detailed Gopkg.toml documentation. # # required = ["github.com/user/thing/cmd/thing"] diff --git a/net/gateway/gateway_windows.go b/net/gateway/gateway_windows.go index 685f2c2..d481c7c 100644 --- a/net/gateway/gateway_windows.go +++ b/net/gateway/gateway_windows.go @@ -1,13 +1,17 @@ package gateway import ( + "log" "net" "os/exec" ) func DiscoverGateway() (ip net.IP, iface string, err error) { - routeCmd := exec.Command("route", "print", "0.0.0.0") - output, err := routeCmd.CombinedOutput() + output, err := exec.Command("cmd.exe", "/C", "chcp 437 && route print 0.0.0.0").CombinedOutput() + if err != nil { + panic(err) + } + log.Println(string(output)) if err != nil { return nil, "", err }