Skip to content

Commit a045e25

Browse files
authored
Merge pull request #13 from holyachon/use-errors-is
fix: use errors.Is for checking equity
2 parents 703406d + 33fb7b1 commit a045e25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

http.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"context"
66
"encoding/json"
7+
"errors"
78
"fmt"
89
"io"
910
"net/http"
@@ -220,7 +221,7 @@ func ShouldRetryDefault(status int, err error) bool {
220221
if status == http.StatusTooManyRequests {
221222
return true
222223
}
223-
if err == io.ErrUnexpectedEOF {
224+
if errors.Is(err, io.ErrUnexpectedEOF) {
224225
return true
225226
}
226227

0 commit comments

Comments
 (0)