mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 16:24:03 +03:00
Update golangci-lint
This commit is contained in:
@@ -6,10 +6,9 @@ import (
|
||||
"io"
|
||||
"net"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/9seconds/mtg/conntypes"
|
||||
"github.com/9seconds/mtg/utils"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,9 +7,8 @@ import (
|
||||
"io"
|
||||
"net"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/9seconds/mtg/conntypes"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
const clientIntermediateQuickAckLength = 0x80000000
|
||||
|
||||
@@ -6,9 +6,8 @@ import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/9seconds/mtg/conntypes"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type wrapperClientIntermediateSecure struct {
|
||||
@@ -36,7 +35,7 @@ func (w *wrapperClientIntermediateSecure) Write(packet conntypes.Packet, acks *c
|
||||
}
|
||||
|
||||
buf := &bytes.Buffer{}
|
||||
paddingLength := rand.Intn(4)
|
||||
paddingLength := rand.Intn(4) // nolint: gosec
|
||||
|
||||
buf.Grow(4 + len(packet) + paddingLength)
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ func (w *wrapperProxy) Read(acks *conntypes.ConnectionAcks) (conntypes.Packet, e
|
||||
|
||||
func (w *wrapperProxy) Close() error {
|
||||
w.proxy.Close()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -77,7 +78,7 @@ func NewProxy(request *protocol.TelegramRequest) (conntypes.PacketAckReadWriteCl
|
||||
flags |= rpc.ProxyRequestFlagsIntermediate
|
||||
case conntypes.ConnectionTypeSecure:
|
||||
flags |= rpc.ProxyRequestFlagsIntermediate | rpc.ProxyRequestFlagsPad
|
||||
default:
|
||||
case conntypes.ConnectionTypeUnknown:
|
||||
panic("unknown connection type")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user