The following errors were introduced in beats release 6.6.1 with #10477.
go build -i -ldflags "-X github.com/elastic/beats/libbeat/version.buildTime=2019-03-04T08:34:22Z -X github.com/elastic/beats/libbeat/version.commit=6.6.1"
# github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap
../vendor/github.com/tsg/gopacket/pcap/pcap.go:173:7: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../vendor/github.com/tsg/gopacket/pcap/pcap.go:385:13: identifier "_Ctype_struct_pcap_stat" may conflict with identifiers generated by cgo
../vendor/github.com/tsg/gopacket/pcap/pcap.go:446:10: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../vendor/github.com/tsg/gopacket/pcap/pcap.go:489:21: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../vendor/github.com/tsg/gopacket/pcap/pcap.go:552:34: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
../vendor/github.com/tsg/gopacket/pcap/pcap.go:555:56: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
../vendor/github.com/tsg/gopacket/pcap/pcap.go:821:13: identifier "_Ctype_struct_pcap_pkthdr" may conflict with identifiers generated by cgo
make: *** [../libbeat/scripts/Makefile:100: packetbeat] Error 2
The issue is present in the vendored tsg/gopacket but is already fixed in google/gopacket#589.