From 372c0a2e7f786c08494bf09266275c9d0f3c4af6 Mon Sep 17 00:00:00 2001 From: Simon Cousineau Date: Fri, 2 Feb 2024 18:28:52 +0000 Subject: [PATCH] Compare with errors.Is --- icegatherer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/icegatherer.go b/icegatherer.go index cce3bbe1fa7..569379f9911 100644 --- a/icegatherer.go +++ b/icegatherer.go @@ -7,6 +7,7 @@ package webrtc import ( + "errors" "fmt" "sync" "sync/atomic" @@ -192,7 +193,7 @@ func (g *ICEGatherer) Close() error { if g.agent == nil { return nil - } else if err := g.agent.Close(); err != nil && err != ice.ErrClosed { + } else if err := g.agent.Close(); err != nil && !errors.Is(err, ice.ErrClosed) { return err }