lib/db/backend: Prevent panic in errors.As (#7873)

This commit is contained in:
Simon Frei 2021-08-05 12:25:20 +02:00 committed by GitHub
parent fe77fac23f
commit 952f3ffb0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -142,12 +142,12 @@ type errNotFound struct{}
func (*errNotFound) Error() string { return "key not found" }
func IsClosed(err error) bool {
var e *errClosed
e := &errClosed{}
return errors.As(err, &e)
}
func IsNotFound(err error) bool {
var e *errNotFound
e := &errNotFound{}
return errors.As(err, &e)
}