Packet capturing is the process of monitoring the raw traffic going through a network. This applies to wired Ethernet and wireless network devices. The tcpdump and libpcap packages are the standard when it comes to packet capturing. They were written in the 1980s and are still being used today. The gopacket package not only wraps the C libraries but also adds layers of Go abstraction to make it more idiomatic to Go and practical to use.
The pcap library allows you to gather information about network devices, read packets off the wire, store traffic in a .pcap file, filter traffic based on a number of criteria, or forge custom packets and send them through the network device. For the pcap library, filtering is done with Berkeley Packet Filters (BPF).
There are countless uses of packet capturing. It can be used to set up honeypots and monitor what...