Skip to content

Commit c9cdc01

Browse files
Fix linter issues
1 parent 2af2446 commit c9cdc01

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

listen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func runLocalSocksProxy(
9494
_ = listener.Close()
9595
}()
9696

97-
defer listener.Close() //nolint:errcheck,gosec
97+
defer listener.Close() //nolint:errcheck
9898

9999
for {
100100
err = handleRelayConnection(ctx, listener, proxyAddr, updateUI)
@@ -120,7 +120,7 @@ func handleRelayConnection(ctx context.Context, listener net.Listener, proxyAddr
120120
_ = relayConn.Close()
121121
}()
122122

123-
defer relayConn.Close() //nolint:errcheck,gosec
123+
defer relayConn.Close() //nolint:errcheck
124124

125125
return proxyrelay.RunProxyWithEventCallback(ctx, relayConn, proxyAddr, func(e proxyrelay.Event) {
126126
if e.Type != proxyrelay.TypeSOCKS5ConnectionOpened && e.Type != proxyrelay.TypeSOCKS5ConnectionClosed {

proxyrelay/proxy.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func startLocalProxyServer(proxyAddr string, sess *yamux.Session, callback func(
124124
return fmt.Errorf("listen for relay connection: %w", err)
125125
}
126126

127-
defer proxyListener.Close() //nolint:errcheck,gosec
127+
defer proxyListener.Close() //nolint:errcheck
128128

129129
if callback != nil {
130130
callback(Event{Type: TypeSOCKS5Active})
@@ -187,8 +187,8 @@ func handleLocalProxyConn(conn net.Conn, sess *yamux.Session) error {
187187
var eg errgroup.Group
188188

189189
eg.Go(func() error {
190-
defer conn.Close() //nolint:errcheck,gosec
191-
defer yamuxConn.Close() //nolint:errcheck,gosec
190+
defer conn.Close() //nolint:errcheck
191+
defer yamuxConn.Close() //nolint:errcheck
192192

193193
_, err := io.Copy(yamuxConn, conn)
194194
if err != nil && !errors.Is(err, net.ErrClosed) {
@@ -199,8 +199,8 @@ func handleLocalProxyConn(conn net.Conn, sess *yamux.Session) error {
199199
})
200200

201201
eg.Go(func() error {
202-
defer conn.Close() //nolint:errcheck,gosec
203-
defer yamuxConn.Close() //nolint:errcheck,gosec
202+
defer conn.Close() //nolint:errcheck
203+
defer yamuxConn.Close() //nolint:errcheck
204204

205205
_, err := io.Copy(conn, yamuxConn)
206206
if err != nil && !errors.Is(err, net.ErrClosed) {

proxyrelay/proxyrelay_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func TestProxyRelay(t *testing.T) { //nolint:cyclop
5858
}()
5959

6060
pipeA, pipeB := net.Pipe()
61-
defer pipeA.Close() //nolint:errcheck,gosec
62-
defer pipeB.Close() //nolint:errcheck,gosec
61+
defer pipeA.Close() //nolint:errcheck
62+
defer pipeB.Close() //nolint:errcheck
6363

6464
var eg errgroup.Group //nolint:varnamelen
6565

proxyrelay/relay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func RunRelayWithEventCallback(ctx context.Context, conn net.Conn, callback func
4343
return fmt.Errorf("accept error notification connection: %w", err)
4444
}
4545

46-
defer errConn.Close() //nolint:errcheck,gosec
46+
defer errConn.Close() //nolint:errcheck
4747

4848
socksServer, err := socks5.New(&socks5.Config{Logger: newRemoteLogger(errConn, callback)})
4949
if err != nil {

0 commit comments

Comments
 (0)