Skip to content

Commit f5a2fc6

Browse files
committedNov 22, 2021
fix(ping): delete round-trip suffix
1 parent 99a694f commit f5a2fc6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎pkg/ping/ping.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,13 @@ func parsePingOutput(out string) (pingOutput, error) {
147147
switch {
148148
case strings.Contains(line, "packets transmitted"):
149149
arr := strings.Split(line, ",")
150-
fmt.Println(arr)
151150
if len(arr) < 3 {
152151
continue
153152
}
154153

155154
po.PacketTransmitted, po.PacketReceived, po.PacketLoss = arr[0], arr[1], arr[2]
156155

157-
case strings.Contains(line, "round-trip min/avg/max"):
156+
case strings.Contains(line, "min/avg/max"):
158157
l := strings.ReplaceAll(line, " = ", " ")
159158
arr := strings.Split(l, " ")
160159

0 commit comments

Comments
 (0)
Please sign in to comment.