Before running these examples, you need to have libpcap installed. In addition, we have to use a third-party Go package. Fortunately, this package is provided by Google, a trusted source. Go's get ability will download and install the remote package. Git will also be needed for go get to work properly.
Prerequisites
Installing libpcap and Git
The libpcap package dependency does not come pre-installed on most systems, and the installation procedure is different for each operating system. Here we will cover the installation steps for libpcap and git for Ubuntu, Windows, and macOS. I highly recommend that you use Ubuntu or other Linux distributions for best results. Without libpcap, gopacket will not function, and git is...