diff --git a/models/db/error.go b/models/db/error.go index 65572299436a6..d52ddcabee500 100644 --- a/models/db/error.go +++ b/models/db/error.go @@ -48,9 +48,15 @@ type ErrNotExist struct { ID int64 } +type errNotExist interface { + isErrNotExist() +} + +func (err ErrNotExist) isErrNotExist() {} + // IsErrNotExist checks if an error is an ErrNotExist func IsErrNotExist(err error) bool { - _, ok := err.(ErrNotExist) + _, ok := err.(errNotExist) return ok }