diff options
author | Simon Frei <freisim93@gmail.com> | 2021-08-05 12:25:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-05 11:25:20 +0100 |
commit | 952f3ffb0c0d334d08c71942e26edd6e97bb5e56 (patch) | |
tree | 150235d245f58783cb33c3a7deeee0283b33aa7c | |
parent | fe77fac23ff40e88eec7cdd1e9c2c711f4b3977d (diff) |
lib/db/backend: Prevent panic in errors.As (#7873)
-rw-r--r-- | lib/db/backend/backend.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/db/backend/backend.go b/lib/db/backend/backend.go index e444b9ce4f..4f6f28ba64 100644 --- a/lib/db/backend/backend.go +++ b/lib/db/backend/backend.go @@ -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) } |