From d840651a2421fc05f8e98004fbc4be8a5797bb1a Mon Sep 17 00:00:00 2001 From: konrad Date: Sun, 10 Jun 2018 11:35:53 +0200 Subject: [PATCH] removed unused errors --- models/error.go | 54 +------------------------------------------------ 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/models/error.go b/models/error.go index 768d68ae..83378c37 100644 --- a/models/error.go +++ b/models/error.go @@ -122,56 +122,4 @@ func IsErrIDCannotBeZero(err error) bool { func (err ErrIDCannotBeZero) Error() string { return fmt.Sprintf("ID cannot be 0") -} - -// ErrAuthorCannotBeEmpty represents a "AuthorCannotBeEmpty" kind of error. -type ErrAuthorCannotBeEmpty struct{} - -// IsErrAuthorCannotBeEmpty checks if an error is a ErrAuthorCannotBeEmpty. -func IsErrAuthorCannotBeEmpty(err error) bool { - _, ok := err.(ErrAuthorCannotBeEmpty) - return ok -} - -func (err ErrAuthorCannotBeEmpty) Error() string { - return fmt.Sprintf("author cannot be empty") -} - -// ErrItemTitleCannotBeEmpty represents a "ErrItemTitleCannotBeEmpty" kind of error. -type ErrItemTitleCannotBeEmpty struct{} - -// IsErrItemTitleCannotBeEmpty checks if an error is a ErrItemTitleCannotBeEmpty. -func IsErrItemTitleCannotBeEmpty(err error) bool { - _, ok := err.(ErrItemTitleCannotBeEmpty) - return ok -} - -func (err ErrItemTitleCannotBeEmpty) Error() string { - return fmt.Sprintf("title cannot be empty") -} - -// ErrBookTitleCannotBeEmpty represents a "ErrBookTitleCannotBeEmpty" kind of error. -type ErrBookTitleCannotBeEmpty struct{} - -// IsErrBookTitleCannotBeEmpty checks if an error is a ErrBookTitleCannotBeEmpty. -func IsErrBookTitleCannotBeEmpty(err error) bool { - _, ok := err.(ErrBookTitleCannotBeEmpty) - return ok -} - -func (err ErrBookTitleCannotBeEmpty) Error() string { - return fmt.Sprintf("the book should at least have a title") -} - -// ErrNoPublisherName represents a "ErrNoPublisherName" kind of error. -type ErrNoPublisherName struct{} - -// IsErrNoPublisherName checks if an error is a ErrNoPublisherName. -func IsErrNoPublisherName(err error) bool { - _, ok := err.(ErrNoPublisherName) - return ok -} - -func (err ErrNoPublisherName) Error() string { - return fmt.Sprintf("you need at least a name to insert a new publisher") -} +} \ No newline at end of file