Registry / networking / go-ping-ping

go-ping-ping

JSON →
library1.2.0gogounverified

A simple but powerful ICMP echo (ping) library for Go.

go get github.com/go-ping/ping
INSTALL
IMPORT
SIG · GO-PING-PING
G
go-ping-ping
networkinggov1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ping
github.com/go-ping/ping

Pings a host and prints packet statistics.

package main import ( "fmt" "github.com/go-ping/ping" ) func main() { pinger, err := ping.NewPinger("google.com") if err != nil { panic(err) } pinger.Count = 3 pinger.Run() stats := pinger.Statistics() fmt.Printf("Sent: %d, Received: %d\n", stats.PacketsSent, stats.PacketsRecv) }
Debug
Known issues
gotchaRequires root or CAP_NET_RAW on Linux for ICMP sockets.
fix
Run with sudo or set capabilities: sudo setcap cap_net_raw+ep /path/to/binary
affects: all
Upgrade
Version history
1.2.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
go-ping-ping — go get go-ping-ping · libregistry