fix incorrect usage of errors.Is

errors.Is is supposed to used for equality of errors, not for type
assertions. That's what errors.As is there for.
This commit is contained in:
Marten Seemann
2021-06-26 15:18:54 -07:00
parent a887f8f436
commit dbb517858e
10 changed files with 37 additions and 133 deletions

View File

@@ -18,11 +18,6 @@ type headerParseError struct {
err error
}
func (e *headerParseError) Is(err error) bool {
_, ok := err.(*headerParseError)
return ok
}
func (e *headerParseError) Unwrap() error {
return e.err
}