Skip to content

Commit

Permalink
Merge pull request statping#623 from zeeZ/bugfix/602-icmp-broken
Browse files Browse the repository at this point in the history
separate command options and option arguments
  • Loading branch information
hunterlong authored Jun 10, 2020
2 parents e3c8b9b + 271264f commit 45a0494
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions utils/utils_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package utils

import (
"errors"
"fmt"
"os"
"os/exec"
"strconv"
"strings"
"syscall"
)
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions utils/utils_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package utils

import (
"errors"
"fmt"
"os"
"os/exec"
"strconv"
"strings"
)

Expand All @@ -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
}
Expand Down

0 comments on commit 45a0494

Please sign in to comment.