Skip to content

Commit

Permalink
use errors.Is to compare errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Jun 5, 2020
1 parent ab19177 commit eb848a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/announcer/announce.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package announcer

import (
"context"
"errors"

"github.com/cenkalti/rain/internal/tracker"
)
Expand All @@ -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 {
Expand Down

0 comments on commit eb848a6

Please sign in to comment.