mirror of
https://github.com/go-ping/ping.git
synced 2025-09-14 22:19:15 +00:00
README typos
This commit is contained in:
@@ -21,9 +21,9 @@ Here is an example that emulates the unix ping command:
|
|||||||
```go
|
```go
|
||||||
pinger, err := ping.NewPinger("www.google.com")
|
pinger, err := ping.NewPinger("www.google.com")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("ERROR: %s\n", err.Error())
|
panic(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pinger.OnRecv = func(pkt *ping.Packet) {
|
pinger.OnRecv = func(pkt *ping.Packet) {
|
||||||
fmt.Printf("%d bytes from %s: icmp_seq=%d time=%v\n",
|
fmt.Printf("%d bytes from %s: icmp_seq=%d time=%v\n",
|
||||||
pkt.Nbytes, pkt.IPAddr, pkt.Seq, pkt.Rtt)
|
pkt.Nbytes, pkt.IPAddr, pkt.Seq, pkt.Rtt)
|
||||||
@@ -35,6 +35,7 @@ Here is an example that emulates the unix ping command:
|
|||||||
fmt.Printf("round-trip min/avg/max/stddev = %v/%v/%v/%v\n",
|
fmt.Printf("round-trip min/avg/max/stddev = %v/%v/%v/%v\n",
|
||||||
stats.MinRtt, stats.AvgRtt, stats.MaxRtt, stats.StdDevRtt)
|
stats.MinRtt, stats.AvgRtt, stats.MaxRtt, stats.StdDevRtt)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("PING %s (%s):\n", pinger.Addr(), pinger.IPAddr())
|
fmt.Printf("PING %s (%s):\n", pinger.Addr(), pinger.IPAddr())
|
||||||
pinger.Run()
|
pinger.Run()
|
||||||
```
|
```
|
||||||
@@ -44,7 +45,7 @@ it calls the "receive" callback. When it's finished, it calls the "finish"
|
|||||||
callback.
|
callback.
|
||||||
|
|
||||||
For a full ping example, see
|
For a full ping example, see
|
||||||
[cmd/ping/ping.go"](https://github.com/sparrc/go-ping/blob/master/cmd/ping/ping.go)
|
[cmd/ping/ping.go](https://github.com/sparrc/go-ping/blob/master/cmd/ping/ping.go)
|
||||||
|
|
||||||
## Installation:
|
## Installation:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user