Skip to content

Commit

Permalink
Merge pull request #751 from wader/bump-github-golangci-lint-1.54.2
Browse files Browse the repository at this point in the history
Update github-golangci-lint to 1.54.2 from 1.54.1
  • Loading branch information
wader authored Aug 21, 2023
2 parents 7189798 + 0cefc46 commit 4930a3e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

env:
GOLANGCILINT_VERSION: "1.54.1"
GOLANGCILINT_VERSION: "1.54.2"

jobs:
lint:
Expand Down
12 changes: 6 additions & 6 deletions format/inet/flowsdecoder/flowsdecoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ type TCPDirection struct {
}

type TCPConnection struct {
Client TCPDirection
Server TCPDirection
Client *TCPDirection
Server *TCPDirection
tcpState *reassembly.TCPSimpleFSM
optChecker *reassembly.TCPOptionCheck
net gopacket.Flow
Expand Down Expand Up @@ -62,9 +62,9 @@ func (t *TCPConnection) ReassembledSG(sg reassembly.ScatterGather, ac reassembly
var d *TCPDirection
switch dir {
case reassembly.TCPDirClientToServer:
d = &t.Client
d = t.Client
case reassembly.TCPDirServerToClient:
d = &t.Server
d = t.Server
default:
panic("unreachable")
}
Expand Down Expand Up @@ -115,14 +115,14 @@ func (fd *Decoder) New(net, transport gopacket.Flow, tcp *layers.TCP, ac reassem
}

stream := &TCPConnection{
Client: TCPDirection{
Client: &TCPDirection{
Endpoint: TCPEndpoint{
IP: append([]byte(nil), net.Src().Raw()...),
Port: clientPort,
},
Buffer: &bytes.Buffer{},
},
Server: TCPDirection{
Server: &TCPDirection{
Endpoint: TCPEndpoint{
IP: append([]byte(nil), net.Dst().Raw()...),
Port: serverPort,
Expand Down
4 changes: 2 additions & 2 deletions format/pcap/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func fieldFlows(d *decode.D, fd *flowsdecoder.Decoder, tcpStreamFormat decode.Gr
var clientV any
var serverV any
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,
HasStart: s.Client.HasStart,
HasEnd: s.Client.HasEnd,
Expand All @@ -69,7 +69,7 @@ func fieldFlows(d *decode.D, fd *flowsdecoder.Decoder, tcpStreamFormat decode.Gr
})
})
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,
HasStart: s.Server.HasStart,
HasEnd: s.Server.HasEnd,
Expand Down
14 changes: 7 additions & 7 deletions format/riff/avi.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ type idx1Sample struct {

type aviStream struct {
hasFormat bool
format decode.Group
format *decode.Group
formatInArg any
indexes []ranges.Range
ixSamples []ranges.Range
Expand Down Expand Up @@ -390,11 +390,11 @@ func aviDecode(d *decode.D) any {
format.BMPTagH264_UMSV,
format.BMPTagH264_tshd,
format.BMPTagH264_INMC:
s.format = aviMpegAVCAUGroup
s.format = &aviMpegAVCAUGroup
s.hasFormat = true
case format.BMPTagHEVC,
format.BMPTagHEVC_H265:
s.format = aviMpegHEVCAUGroup
s.format = &aviMpegHEVCAUGroup
s.hasFormat = true
}

Expand All @@ -417,11 +417,11 @@ func aviDecode(d *decode.D) any {

switch formatTag {
case format.WAVTagMP3:
s.format = aviMp3FrameGroup
s.format = &aviMp3FrameGroup
s.hasFormat = true
case format.WAVTagFLAC:
// TODO: can flac in avi have streaminfo somehow?
s.format = aviFLACFrameGroup
s.format = &aviFLACFrameGroup
s.hasFormat = true
}
case "iavs":
Expand Down Expand Up @@ -521,7 +521,7 @@ func aviDecode(d *decode.D) any {
index < len(streams) &&
streams[index].hasFormat:
s := streams[index]
d.FieldFormatLen("data", d.BitsLeft(), &s.format, s.formatInArg)
d.FieldFormatLen("data", d.BitsLeft(), s.format, s.formatInArg)
default:
d.FieldRawLen("data", d.BitsLeft())
}
Expand Down Expand Up @@ -559,7 +559,7 @@ func aviDecode(d *decode.D) any {
decodeSample := func(d *decode.D, sr ranges.Range) {
d.RangeFn(sr.Start, sr.Len, func(d *decode.D) {
if sr.Len > 0 && ai.DecodeSamples && s.hasFormat {
d.FieldFormat("sample", &s.format, s.formatInArg)
d.FieldFormat("sample", s.format, s.formatInArg)
} else {
d.FieldRawLen("sample", d.BitsLeft())
}
Expand Down
4 changes: 2 additions & 2 deletions format/xml/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func fromHTMLToArray(n *html.Node) any {
return f(n)
}

var htmlMagicRe = &lazyre.RE{S: `` +
var htmlMagicRE = &lazyre.RE{S: `` +
`^` + // anchor to start
`(?i)` + // case insensitive
`[[:graph:][:space:]]{0,64}?` + // 0-64 non-control ASCII lazily to allow comment etc
Expand All @@ -214,7 +214,7 @@ func decodeHTML(d *decode.D) any {
if d.ArgAs(&pi) {
// 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
if d.RE(htmlMagicRe.Must()) == nil {
if d.RE(htmlMagicRE.Must()) == nil {
d.Fatalf("no <html> or <!DOCTYPE html> found")
}
}
Expand Down

0 comments on commit 4930a3e

Please sign in to comment.