fix(lint): устранить замечания golangci-lint + переход на dockers_v2
Проход lint (52 → 0): - vkauth/token: переименовать затенённый err (govet shadow x3) - udprelay/loop: явный _ = conn.Close() (errcheck x2) - captcha/manual: ReadHeaderTimeout + html.EscapeString (G112, G705) - proxy/tcpfwd: хелпер nonNegUint64 для байтовых счётчиков io.Copy (G115) - proxy/bondclient, wire/bondframe: bounds-проверки на len->uint16/uint32 - wire/srtpmimicry: задокументирована усечка RTP seq mod 2^16 - dnsdial/doh: bounds-проверка + binary.BigEndian.PutUint16 - captcha/slider: clamp luma до 255 перед конверсией uint8 - vkauth/types: обоснованный nolint для публичных учёток VK SDK Новый пакет internal/randx — Intn/IntN/Float64 на crypto/rand, drop-in замена math/rand. Мигрированы все места antifingerprint-jitter (~22) в captcha, slider, namegen, vkauth, udprelay. GoReleaser: - bump GORELEASER_VERSION v2.5.0 → v2.15.4 в Taskfile и обоих CI-workflow; текущий синтаксис .goreleaser.yaml (archives.ids, format_overrides.formats) требует v2.8+ - миграция dockers + docker_manifests → dockers_v2 (единый блок, multi-platform buildx); Dockerfile.goreleaser использует конвенцию ARG TARGETPLATFORM
This commit is contained in:
1 parent
f8bc3f54e5
commit
dd8233208c
20 files changed
+156
-109
No files matched your search
@@ -9,6 +9,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -76,11 +77,14 @@ func (h *Handler) Handle(ctx context.Context, tcpConn net.Conn, connID uint64, c
|
||||
opened = append(opened, pending{ps: ps, stream: stream})
|
||||
}
|
||||
|
||||
if len(opened) > math.MaxUint16 {
|
||||
opened = opened[:math.MaxUint16]
|
||||
}
|
||||
lanes := make([]*lane, 0, len(opened))
|
||||
laneIDs := make([]string, 0, len(opened))
|
||||
laneCount := uint16(len(opened))
|
||||
laneCount := uint16(len(opened)) //nolint:gosec // bounded above by MaxUint16
|
||||
for i, p := range opened {
|
||||
if err := bondframe.WriteHello(p.stream, connID, uint16(i), laneCount); err != nil {
|
||||
if err := bondframe.WriteHello(p.stream, connID, uint16(i), laneCount); err != nil { //nolint:gosec // i < laneCount <= MaxUint16
|
||||
h.Deps.log().Errorf("[bond %d] session %d hello error: %s", connID, p.ps.ID, err)
|
||||
_ = p.stream.Close()
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user