From f2d6722348d8ba51b4e7b11ad1176f73cb75a3b1 Mon Sep 17 00:00:00 2001 From: WangXi Date: Thu, 16 May 2024 15:01:16 +0800 Subject: [PATCH] lib/connections: Use proper errors.Is check (#9538) --- lib/connections/quic_listen.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/connections/quic_listen.go b/lib/connections/quic_listen.go index df1384df6..2418a0404 100644 --- a/lib/connections/quic_listen.go +++ b/lib/connections/quic_listen.go @@ -12,6 +12,7 @@ package connections import ( "context" "crypto/tls" + "errors" "net" "net/url" "sync" @@ -145,7 +146,7 @@ func (t *quicListener) serve(ctx context.Context) error { } session, err := listener.Accept(ctx) - if err == context.Canceled { + if errors.Is(err, context.Canceled) { return nil } else if err != nil { l.Infoln("Listen (BEP/quic): Accepting connection:", err)