> be fist commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package xlerrors
|
||||
|
||||
type notFoundError struct {
|
||||
Subject string
|
||||
}
|
||||
|
||||
func (err *notFoundError) Error() string {
|
||||
return err.Subject + " not found"
|
||||
}
|
||||
|
||||
func NotFound(subject string) error {
|
||||
return ¬FoundError{Subject: subject}
|
||||
}
|
||||
|
||||
func IsNotFound(err error) bool {
|
||||
_, ok := err.(*notFoundError)
|
||||
return ok
|
||||
}
|
||||
Reference in New Issue
Block a user