removed unused errors
This commit is contained in:
parent
1bee67cac7
commit
d840651a24
1 changed files with 1 additions and 53 deletions
|
@ -123,55 +123,3 @@ func IsErrIDCannotBeZero(err error) bool {
|
||||||
func (err ErrIDCannotBeZero) Error() string {
|
func (err ErrIDCannotBeZero) Error() string {
|
||||||
return fmt.Sprintf("ID cannot be 0")
|
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")
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue