gateway_windows : chcp 437

This commit is contained in:
insanity 2018-08-23 18:29:29 +09:00
parent 7d0f0cdbd5
commit 2339fcd264

View File

@ -6,8 +6,10 @@ import (
) )
func DiscoverGateway() (ip net.IP, iface string, err error) { func DiscoverGateway() (ip net.IP, iface string, err error) {
routeCmd := exec.Command("route", "print", "0.0.0.0") output, err := exec.Command("cmd.exe", "/C", "chcp 437 && route print 0.0.0.0").CombinedOutput()
output, err := routeCmd.CombinedOutput() if err != nil {
panic(err)
}
if err != nil { if err != nil {
return nil, "", err return nil, "", err
} }