From 64f612db4cacf26b44a250e1c5dee2a538e7ec45 Mon Sep 17 00:00:00 2001 From: dustoair <107600816+dustoair@users.noreply.github.com> Date: Wed, 10 Aug 2022 14:16:08 +0800 Subject: [PATCH] int dropPack show %d --- goping/goping.go | 4 ++-- readme.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/goping/goping.go b/goping/goping.go index 5fd9996..bfe4d34 100644 --- a/goping/goping.go +++ b/goping/goping.go @@ -178,9 +178,9 @@ func foot(address string, icmp_seq int, dropPack, min_lan, avg_lan, max_lan floa icmp_seq -= 1 //最后一个seq没统计过来 fmt.Printf("\n--- %s ping statistics ---\n", address) if dropPack >= 1 { - fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), red("lost"), dropPack/float64(icmp_seq)*100) + fmt.Printf("%d packets transmitted, %d %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), red("lost"), dropPack/float64(icmp_seq)*100) } else { - fmt.Printf("%d packets transmitted, %f %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), green("lost"), dropPack/float64(icmp_seq)*100) + fmt.Printf("%d packets transmitted, %d %s, %.2f%% packet loss, time 1000ms\n", icmp_seq, int(dropPack), green("lost"), dropPack/float64(icmp_seq)*100) } if len(ret_list) == 0 { diff --git a/readme.md b/readme.md index d212fcc..9f5861c 100644 --- a/readme.md +++ b/readme.md @@ -23,7 +23,7 @@ mv pong /usr/bin/ pong www.baidu.com 443 ``` -## build +## build amd64 on vm ```bash cd /root rm -rf pong