diff --git a/mtglib/internal/dc/public_config_updater.go b/mtglib/internal/dc/public_config_updater.go index 40ecbe7..8f22832 100644 --- a/mtglib/internal/dc/public_config_updater.go +++ b/mtglib/internal/dc/public_config_updater.go @@ -29,8 +29,8 @@ func (p PublicConfigUpdater) Run(ctx context.Context, url, network string) { resp, err := p.http.Do(req) if err != nil { if resp != nil { - io.Copy(io.Discard, resp.Body) - resp.Body.Close() + io.Copy(io.Discard, resp.Body) //nolint: errcheck + resp.Body.Close() //nolint: errcheck } return fmt.Errorf("cannot fetch url %s: %w", url, err) } diff --git a/mtglib/internal/dc/public_config_updater_test.go b/mtglib/internal/dc/public_config_updater_test.go index 4da1773..f51f3a2 100644 --- a/mtglib/internal/dc/public_config_updater_test.go +++ b/mtglib/internal/dc/public_config_updater_test.go @@ -90,7 +90,7 @@ lala 0 0 s.responseHandler = func(w http.ResponseWriter) { done = true w.WriteHeader(http.StatusOK) - w.Write([]byte(result)) + w.Write([]byte(result)) //nolint: errcheck } go s.u.Run(s.ctx, s.srv.URL, "tcp4") @@ -114,7 +114,7 @@ proxy_for -100 101.10.0.0:3333; s.responseHandler = func(w http.ResponseWriter) { done = true w.WriteHeader(http.StatusOK) - w.Write([]byte(result)) + w.Write([]byte(result)) //nolint: errcheck } go s.u.Run(s.ctx, s.srv.URL, "tcp4") diff --git a/mtglib/internal/dc/telegram.go b/mtglib/internal/dc/telegram.go index c9a85d4..fcd3fd7 100644 --- a/mtglib/internal/dc/telegram.go +++ b/mtglib/internal/dc/telegram.go @@ -1,14 +1,12 @@ package dc import ( - "context" "fmt" "strings" "sync" ) type Telegram struct { - ctx context.Context lock sync.RWMutex view dcView preferIP preferIP diff --git a/mtglib/internal/obfuscation/obfuscator_test.go b/mtglib/internal/obfuscation/obfuscator_test.go index 0280b26..fbc018e 100644 --- a/mtglib/internal/obfuscation/obfuscator_test.go +++ b/mtglib/internal/obfuscation/obfuscator_test.go @@ -20,7 +20,7 @@ type ObfuscatorTestSuite struct { } func (s *ObfuscatorTestSuite) SetupSuite() { - s.SnapshotTestSuite.Setup("", "client-handshake") + s.Setup("", "client-handshake") secret := mtglib.GenerateSecret("hostname.com") s.secret = &secret diff --git a/mtglib/proxy.go b/mtglib/proxy.go index 78f239d..1f12345 100644 --- a/mtglib/proxy.go +++ b/mtglib/proxy.go @@ -245,7 +245,7 @@ func (p *Proxy) doTelegramCall(ctx *streamContext) error { tgConn, err := foundAddr.Obfuscator.SendHandshake(conn, ctx.dc) if err != nil { - conn.Close() + conn.Close() // nolint: errcheck return fmt.Errorf("cannot perform server handshake: %w", err) }