mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 06:24:01 +03:00
Update to go 1.19
This commit is contained in:
@@ -20,7 +20,7 @@ func (w *wrapperClientIntermediateSecure) Read(acks *conntypes.ConnectionAcks) (
|
||||
return nil, err
|
||||
}
|
||||
|
||||
length := len(data) - (len(data) % 4) // nolint: gomnd
|
||||
length := len(data) - (len(data) % 4) //nolint: gomnd
|
||||
|
||||
return data[:length], nil
|
||||
}
|
||||
@@ -35,11 +35,11 @@ func (w *wrapperClientIntermediateSecure) Write(packet conntypes.Packet, acks *c
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
paddingLength := rand.Intn(4) // nolint: gosec, gomnd
|
||||
paddingLength := rand.Intn(4) //nolint: gosec, gomnd
|
||||
|
||||
buf.Grow(4 + len(packet) + paddingLength)
|
||||
|
||||
binary.Write(buf, binary.LittleEndian, uint32(len(packet)+paddingLength)) // nolint: errcheck
|
||||
binary.Write(buf, binary.LittleEndian, uint32(len(packet)+paddingLength)) //nolint: errcheck
|
||||
buf.Write(packet)
|
||||
buf.Write(make([]byte, paddingLength))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user