diff --git a/internal/announcer/announce.go b/internal/announcer/announce.go index c5c8ed39..67131c95 100644 --- a/internal/announcer/announce.go +++ b/internal/announcer/announce.go @@ -2,6 +2,7 @@ package announcer import ( "context" + "errors" "github.com/cenkalti/rain/internal/tracker" ) @@ -21,7 +22,7 @@ func announce( NumWant: numWant, } annResp, err := trk.Announce(ctx, annReq) - if err == context.Canceled { + if errors.Is(err, context.Canceled) { return } if err != nil {