mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
lib/db/backend: Prevent panic in errors.As (#7873)
This commit is contained in:
parent
fe77fac23f
commit
952f3ffb0c
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user