Pinger.New() runs connectICMP() which runs icmp.ListenPacket(network, address) using static value "ip4:icmp" as network. Per icmp.ListenPacket() def, this only allows usage of privileged endpoints.
ListenPacket listens for incoming ICMP packets addressed to address. See net.Dial for the syntax of address.
For non-privileged datagram-oriented ICMP endpoints, network must be "udp4" or "udp6". The endpoint allows to read, write a few limited ICMP messages such as echo request and echo reply. Currently only Darwin and Linux support this.
Pinger.New() runs connectICMP() which runs icmp.ListenPacket(network, address) using static value "ip4:icmp" as network. Per icmp.ListenPacket() def, this only allows usage of privileged endpoints.