mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 11:54:01 +03:00
Fix lint issues
This commit is contained in:
@@ -29,8 +29,8 @@ func (p PublicConfigUpdater) Run(ctx context.Context, url, network string) {
|
|||||||
resp, err := p.http.Do(req)
|
resp, err := p.http.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if resp != nil {
|
if resp != nil {
|
||||||
io.Copy(io.Discard, resp.Body)
|
io.Copy(io.Discard, resp.Body) //nolint: errcheck
|
||||||
resp.Body.Close()
|
resp.Body.Close() //nolint: errcheck
|
||||||
}
|
}
|
||||||
return fmt.Errorf("cannot fetch url %s: %w", url, err)
|
return fmt.Errorf("cannot fetch url %s: %w", url, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ lala 0 0
|
|||||||
s.responseHandler = func(w http.ResponseWriter) {
|
s.responseHandler = func(w http.ResponseWriter) {
|
||||||
done = true
|
done = true
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write([]byte(result))
|
w.Write([]byte(result)) //nolint: errcheck
|
||||||
}
|
}
|
||||||
go s.u.Run(s.ctx, s.srv.URL, "tcp4")
|
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) {
|
s.responseHandler = func(w http.ResponseWriter) {
|
||||||
done = true
|
done = true
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write([]byte(result))
|
w.Write([]byte(result)) //nolint: errcheck
|
||||||
}
|
}
|
||||||
go s.u.Run(s.ctx, s.srv.URL, "tcp4")
|
go s.u.Run(s.ctx, s.srv.URL, "tcp4")
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
package dc
|
package dc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Telegram struct {
|
type Telegram struct {
|
||||||
ctx context.Context
|
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
view dcView
|
view dcView
|
||||||
preferIP preferIP
|
preferIP preferIP
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type ObfuscatorTestSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *ObfuscatorTestSuite) SetupSuite() {
|
func (s *ObfuscatorTestSuite) SetupSuite() {
|
||||||
s.SnapshotTestSuite.Setup("", "client-handshake")
|
s.Setup("", "client-handshake")
|
||||||
|
|
||||||
secret := mtglib.GenerateSecret("hostname.com")
|
secret := mtglib.GenerateSecret("hostname.com")
|
||||||
s.secret = &secret
|
s.secret = &secret
|
||||||
|
|||||||
+1
-1
@@ -245,7 +245,7 @@ func (p *Proxy) doTelegramCall(ctx *streamContext) error {
|
|||||||
|
|
||||||
tgConn, err := foundAddr.Obfuscator.SendHandshake(conn, ctx.dc)
|
tgConn, err := foundAddr.Obfuscator.SendHandshake(conn, ctx.dc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
conn.Close()
|
conn.Close() // nolint: errcheck
|
||||||
return fmt.Errorf("cannot perform server handshake: %w", err)
|
return fmt.Errorf("cannot perform server handshake: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user