From f02b66bcd79121efd1e44012fe798a1657189bab Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 17 Sep 2018 20:13:01 +0900 Subject: [PATCH] ing --- net/ping/ping_windows.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/ping/ping_windows.go b/net/ping/ping_windows.go index 43400de..ee30e85 100644 --- a/net/ping/ping_windows.go +++ b/net/ping/ping_windows.go @@ -9,11 +9,15 @@ func Ping(destination string, options *PingOptions) (*PingResult, error) { options.Validate() params := make([]string, 0) + params = append(params, "/C") + params = append(params, "chcp 437") + params = append(params, "&&") + params = append(params, "ping") params = append(params, destination) params = append(params, fmt.Sprintf("-n %d", options.Retry)) params = append(params, fmt.Sprintf("-w %d", options.Deadline*1000)) - pCmd := exec.Command("cmd.exe", "/C", "chcp 437", "&&", "ping", params...) + pCmd := exec.Command("cmd.exe", params...) output, err := pCmd.CombinedOutput() if err != nil { return "", err