Fix linter errors

This commit is contained in:
M. Mert Yildiran
2022-04-28 19:22:22 +03:00
parent 8039970116
commit 82f8f6f20f
3 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ func (h *afPacketHandle) SetBPF(expr string) (err error) {
}
bpfIns = append(bpfIns, bpfIns2)
}
h.capture.SetBPF(bpfIns)
err = h.capture.SetBPF(bpfIns)
return
}
+2 -4
View File
@@ -9,10 +9,8 @@ import (
)
type pcapHandle struct {
source *gopacket.PacketSource
capture *pcap.Handle
decoder gopacket.Decoder
decodeOptions gopacket.DecodeOptions
source *gopacket.PacketSource
capture *pcap.Handle
}
func (h *pcapHandle) NextPacket() (packet gopacket.Packet, err error) {
+1 -1
View File
@@ -76,7 +76,7 @@ func newTcpPacketSource(name, filename string, interfaceName string,
logger.Log.Infof("Using AF_PACKET socket as the capture source")
}
decoder := gopacket.DecodersByLayerName[fmt.Sprintf("%s", layers.LinkTypeEthernet)]
decoder := gopacket.DecodersByLayerName[string(layers.LinkTypeEthernet)]
result.Handle.SetDecoder(decoder, behaviour.Lazy, true)
if behaviour.BpfFilter != "" {