fix: resolve golangci-lint warnings
Добавлена проверка ошибки listener.SetDeadline в tcputil. Удален вызов устаревшего метода SetStreamMode в KCP. Добавлено явное игнорирование возвращаемых значений SetDeadline и io.Copy .
This commit is contained in:
1 parent
4a0b038bdc
commit
7abbd4986f
3 files changed
+15
-14
No files matched your search
+6
-6
@@ -270,8 +270,8 @@ func handleTCPConnection(ctx context.Context, dtlsConn net.Conn, connectAddr str
|
||||
func pipeConn(ctx context.Context, c1, c2 net.Conn) {
|
||||
ctx2, cancel := context.WithCancel(ctx)
|
||||
context.AfterFunc(ctx2, func() {
|
||||
c1.SetDeadline(time.Now())
|
||||
c2.SetDeadline(time.Now())
|
||||
_ = c1.SetDeadline(time.Now())
|
||||
_ = c2.SetDeadline(time.Now())
|
||||
})
|
||||
|
||||
var wg sync.WaitGroup
|
||||
@@ -279,14 +279,14 @@ func pipeConn(ctx context.Context, c1, c2 net.Conn) {
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
defer cancel()
|
||||
io.Copy(c1, c2)
|
||||
_, _ = io.Copy(c1, c2)
|
||||
}()
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
defer cancel()
|
||||
io.Copy(c2, c1)
|
||||
_, _ = io.Copy(c2, c1)
|
||||
}()
|
||||
wg.Wait()
|
||||
c1.SetDeadline(time.Time{})
|
||||
c2.SetDeadline(time.Time{})
|
||||
_ = c1.SetDeadline(time.Time{})
|
||||
_ = c2.SetDeadline(time.Time{})
|
||||
}
|
||||
Reference in new issue
Block a user