mirror of
https://github.com/wader/fq.git
synced 2024-11-23 09:56:07 +03:00
Merge pull request #751 from wader/bump-github-golangci-lint-1.54.2
Update github-golangci-lint to 1.54.2 from 1.54.1
This commit is contained in:
commit
4930a3e3cc
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -7,7 +7,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GOLANGCILINT_VERSION: "1.54.1"
|
GOLANGCILINT_VERSION: "1.54.2"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
|
@ -28,8 +28,8 @@ type TCPDirection struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TCPConnection struct {
|
type TCPConnection struct {
|
||||||
Client TCPDirection
|
Client *TCPDirection
|
||||||
Server TCPDirection
|
Server *TCPDirection
|
||||||
tcpState *reassembly.TCPSimpleFSM
|
tcpState *reassembly.TCPSimpleFSM
|
||||||
optChecker *reassembly.TCPOptionCheck
|
optChecker *reassembly.TCPOptionCheck
|
||||||
net gopacket.Flow
|
net gopacket.Flow
|
||||||
@ -62,9 +62,9 @@ func (t *TCPConnection) ReassembledSG(sg reassembly.ScatterGather, ac reassembly
|
|||||||
var d *TCPDirection
|
var d *TCPDirection
|
||||||
switch dir {
|
switch dir {
|
||||||
case reassembly.TCPDirClientToServer:
|
case reassembly.TCPDirClientToServer:
|
||||||
d = &t.Client
|
d = t.Client
|
||||||
case reassembly.TCPDirServerToClient:
|
case reassembly.TCPDirServerToClient:
|
||||||
d = &t.Server
|
d = t.Server
|
||||||
default:
|
default:
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
}
|
}
|
||||||
@ -115,14 +115,14 @@ func (fd *Decoder) New(net, transport gopacket.Flow, tcp *layers.TCP, ac reassem
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream := &TCPConnection{
|
stream := &TCPConnection{
|
||||||
Client: TCPDirection{
|
Client: &TCPDirection{
|
||||||
Endpoint: TCPEndpoint{
|
Endpoint: TCPEndpoint{
|
||||||
IP: append([]byte(nil), net.Src().Raw()...),
|
IP: append([]byte(nil), net.Src().Raw()...),
|
||||||
Port: clientPort,
|
Port: clientPort,
|
||||||
},
|
},
|
||||||
Buffer: &bytes.Buffer{},
|
Buffer: &bytes.Buffer{},
|
||||||
},
|
},
|
||||||
Server: TCPDirection{
|
Server: &TCPDirection{
|
||||||
Endpoint: TCPEndpoint{
|
Endpoint: TCPEndpoint{
|
||||||
IP: append([]byte(nil), net.Dst().Raw()...),
|
IP: append([]byte(nil), net.Dst().Raw()...),
|
||||||
Port: serverPort,
|
Port: serverPort,
|
||||||
|
@ -59,7 +59,7 @@ func fieldFlows(d *decode.D, fd *flowsdecoder.Decoder, tcpStreamFormat decode.Gr
|
|||||||
var clientV any
|
var clientV any
|
||||||
var serverV any
|
var serverV any
|
||||||
d.FieldStruct("client", func(d *decode.D) {
|
d.FieldStruct("client", func(d *decode.D) {
|
||||||
clientV = f(d, &s.Client, format.TCP_Stream_In{
|
clientV = f(d, s.Client, format.TCP_Stream_In{
|
||||||
IsClient: true,
|
IsClient: true,
|
||||||
HasStart: s.Client.HasStart,
|
HasStart: s.Client.HasStart,
|
||||||
HasEnd: s.Client.HasEnd,
|
HasEnd: s.Client.HasEnd,
|
||||||
@ -69,7 +69,7 @@ func fieldFlows(d *decode.D, fd *flowsdecoder.Decoder, tcpStreamFormat decode.Gr
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
d.FieldStruct("server", func(d *decode.D) {
|
d.FieldStruct("server", func(d *decode.D) {
|
||||||
serverV = f(d, &s.Server, format.TCP_Stream_In{
|
serverV = f(d, s.Server, format.TCP_Stream_In{
|
||||||
IsClient: false,
|
IsClient: false,
|
||||||
HasStart: s.Server.HasStart,
|
HasStart: s.Server.HasStart,
|
||||||
HasEnd: s.Server.HasEnd,
|
HasEnd: s.Server.HasEnd,
|
||||||
|
@ -120,7 +120,7 @@ type idx1Sample struct {
|
|||||||
|
|
||||||
type aviStream struct {
|
type aviStream struct {
|
||||||
hasFormat bool
|
hasFormat bool
|
||||||
format decode.Group
|
format *decode.Group
|
||||||
formatInArg any
|
formatInArg any
|
||||||
indexes []ranges.Range
|
indexes []ranges.Range
|
||||||
ixSamples []ranges.Range
|
ixSamples []ranges.Range
|
||||||
@ -390,11 +390,11 @@ func aviDecode(d *decode.D) any {
|
|||||||
format.BMPTagH264_UMSV,
|
format.BMPTagH264_UMSV,
|
||||||
format.BMPTagH264_tshd,
|
format.BMPTagH264_tshd,
|
||||||
format.BMPTagH264_INMC:
|
format.BMPTagH264_INMC:
|
||||||
s.format = aviMpegAVCAUGroup
|
s.format = &aviMpegAVCAUGroup
|
||||||
s.hasFormat = true
|
s.hasFormat = true
|
||||||
case format.BMPTagHEVC,
|
case format.BMPTagHEVC,
|
||||||
format.BMPTagHEVC_H265:
|
format.BMPTagHEVC_H265:
|
||||||
s.format = aviMpegHEVCAUGroup
|
s.format = &aviMpegHEVCAUGroup
|
||||||
s.hasFormat = true
|
s.hasFormat = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,11 +417,11 @@ func aviDecode(d *decode.D) any {
|
|||||||
|
|
||||||
switch formatTag {
|
switch formatTag {
|
||||||
case format.WAVTagMP3:
|
case format.WAVTagMP3:
|
||||||
s.format = aviMp3FrameGroup
|
s.format = &aviMp3FrameGroup
|
||||||
s.hasFormat = true
|
s.hasFormat = true
|
||||||
case format.WAVTagFLAC:
|
case format.WAVTagFLAC:
|
||||||
// TODO: can flac in avi have streaminfo somehow?
|
// TODO: can flac in avi have streaminfo somehow?
|
||||||
s.format = aviFLACFrameGroup
|
s.format = &aviFLACFrameGroup
|
||||||
s.hasFormat = true
|
s.hasFormat = true
|
||||||
}
|
}
|
||||||
case "iavs":
|
case "iavs":
|
||||||
@ -521,7 +521,7 @@ func aviDecode(d *decode.D) any {
|
|||||||
index < len(streams) &&
|
index < len(streams) &&
|
||||||
streams[index].hasFormat:
|
streams[index].hasFormat:
|
||||||
s := streams[index]
|
s := streams[index]
|
||||||
d.FieldFormatLen("data", d.BitsLeft(), &s.format, s.formatInArg)
|
d.FieldFormatLen("data", d.BitsLeft(), s.format, s.formatInArg)
|
||||||
default:
|
default:
|
||||||
d.FieldRawLen("data", d.BitsLeft())
|
d.FieldRawLen("data", d.BitsLeft())
|
||||||
}
|
}
|
||||||
@ -559,7 +559,7 @@ func aviDecode(d *decode.D) any {
|
|||||||
decodeSample := func(d *decode.D, sr ranges.Range) {
|
decodeSample := func(d *decode.D, sr ranges.Range) {
|
||||||
d.RangeFn(sr.Start, sr.Len, func(d *decode.D) {
|
d.RangeFn(sr.Start, sr.Len, func(d *decode.D) {
|
||||||
if sr.Len > 0 && ai.DecodeSamples && s.hasFormat {
|
if sr.Len > 0 && ai.DecodeSamples && s.hasFormat {
|
||||||
d.FieldFormat("sample", &s.format, s.formatInArg)
|
d.FieldFormat("sample", s.format, s.formatInArg)
|
||||||
} else {
|
} else {
|
||||||
d.FieldRawLen("sample", d.BitsLeft())
|
d.FieldRawLen("sample", d.BitsLeft())
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ func fromHTMLToArray(n *html.Node) any {
|
|||||||
return f(n)
|
return f(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
var htmlMagicRe = &lazyre.RE{S: `` +
|
var htmlMagicRE = &lazyre.RE{S: `` +
|
||||||
`^` + // anchor to start
|
`^` + // anchor to start
|
||||||
`(?i)` + // case insensitive
|
`(?i)` + // case insensitive
|
||||||
`[[:graph:][:space:]]{0,64}?` + // 0-64 non-control ASCII lazily to allow comment etc
|
`[[:graph:][:space:]]{0,64}?` + // 0-64 non-control ASCII lazily to allow comment etc
|
||||||
@ -214,7 +214,7 @@ func decodeHTML(d *decode.D) any {
|
|||||||
if d.ArgAs(&pi) {
|
if d.ArgAs(&pi) {
|
||||||
// if probing the input has to start with "<html" or "<!DOCTYPE html" this
|
// if probing the input has to start with "<html" or "<!DOCTYPE html" this
|
||||||
// is because the html parser will always succeed so we have to be careful
|
// is because the html parser will always succeed so we have to be careful
|
||||||
if d.RE(htmlMagicRe.Must()) == nil {
|
if d.RE(htmlMagicRE.Must()) == nil {
|
||||||
d.Fatalf("no <html> or <!DOCTYPE html> found")
|
d.Fatalf("no <html> or <!DOCTYPE html> found")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user