1
0

Added functions for adding items to a todolist

This commit is contained in:
konrad
2018-06-10 19:49:40 +02:00
committed by kolaente
parent 7bac9f490e
commit 91f67dc364
9 changed files with 190 additions and 2 deletions

View File

@ -142,3 +142,16 @@ func IsErrListDoesNotExist(err error) bool {
func (err ErrListDoesNotExist) Error() string {
return fmt.Sprintf("List does not exist [ID: %d]", err.ID)
}
// ErrListItemCannotBeEmpty represents a "ErrListDoesNotExist" kind of error. Used if the list does not exist.
type ErrListItemCannotBeEmpty struct{}
// IsErrListItemCannotBeEmpty checks if an error is a ErrListDoesNotExist.
func IsErrListItemCannotBeEmpty(err error) bool {
_, ok := err.(ErrListItemCannotBeEmpty)
return ok
}
func (err ErrListItemCannotBeEmpty) Error() string {
return fmt.Sprintf("List item text cannot be empty.")
}