separate command options and option arguments

pull/623/head
zeeZ 2020-06-03 19:40:35 +02:00
parent bb9eacc522
commit 271264fc10
2 changed files with 4 additions and 4 deletions

View File

@ -4,9 +4,9 @@ package utils
import (
"errors"
"fmt"
"os"
"os/exec"
"strconv"
"strings"
"syscall"
)
@ -41,7 +41,7 @@ func Ping(address string, secondsTimeout int) error {
if err != nil {
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 {
return err
}

View File

@ -2,9 +2,9 @@ package utils
import (
"errors"
"fmt"
"os"
"os/exec"
"strconv"
"strings"
)
@ -30,7 +30,7 @@ func Ping(address string, secondsTimeout int) error {
if err != nil {
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 {
return err
}