Merge pull request #623 from zeeZ/bugfix/602-icmp-broken

separate command options and option arguments
pull/655/head
Hunter Long 2020-06-10 10:59:34 -07:00 committed by GitHub
commit 45a04941e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -4,9 +4,9 @@ package utils
import ( import (
"errors" "errors"
"fmt"
"os" "os"
"os/exec" "os/exec"
"strconv"
"strings" "strings"
"syscall" "syscall"
) )
@ -41,7 +41,7 @@ func Ping(address string, secondsTimeout int) error {
if err != nil { if err != nil {
return err return err
} }
out, _, err := Command(ping, address, "-c 1", fmt.Sprintf("-W %v", secondsTimeout)) out, _, err := Command(ping, address, "-c", "1", "-W", strconv.Itoa(secondsTimeout))
if err != nil { if err != nil {
return err return err
} }

View File

@ -2,9 +2,9 @@ package utils
import ( import (
"errors" "errors"
"fmt"
"os" "os"
"os/exec" "os/exec"
"strconv"
"strings" "strings"
) )
@ -30,7 +30,7 @@ func Ping(address string, secondsTimeout int) error {
if err != nil { if err != nil {
return err return err
} }
out, _, err := Command(ping, address, "-n 1", fmt.Sprintf("-w %v", secondsTimeout*1000)) out, _, err := Command(ping, address, "-n", "1", "-w", strconv.Itoa(secondsTimeout*1000))
if err != nil { if err != nil {
return err return err
} }