Fix linter errors

This commit is contained in:
M. Mert Yildiran 2022-04-28 19:22:22 +03:00
parent 8039970116
commit 82f8f6f20f
No known key found for this signature in database
GPG Key ID: D42ADB236521BF7A
3 changed files with 4 additions and 6 deletions

View File

@ -52,7 +52,7 @@ func (h *afPacketHandle) SetBPF(expr string) (err error) {
} }
bpfIns = append(bpfIns, bpfIns2) bpfIns = append(bpfIns, bpfIns2)
} }
h.capture.SetBPF(bpfIns) err = h.capture.SetBPF(bpfIns)
return return
} }

View File

@ -9,10 +9,8 @@ import (
) )
type pcapHandle struct { type pcapHandle struct {
source *gopacket.PacketSource source *gopacket.PacketSource
capture *pcap.Handle capture *pcap.Handle
decoder gopacket.Decoder
decodeOptions gopacket.DecodeOptions
} }
func (h *pcapHandle) NextPacket() (packet gopacket.Packet, err error) { func (h *pcapHandle) NextPacket() (packet gopacket.Packet, err error) {

View File

@ -76,7 +76,7 @@ func newTcpPacketSource(name, filename string, interfaceName string,
logger.Log.Infof("Using AF_PACKET socket as the capture source") 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) result.Handle.SetDecoder(decoder, behaviour.Lazy, true)
if behaviour.BpfFilter != "" { if behaviour.BpfFilter != "" {