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 }