1
0

Added list create and update methods

This commit is contained in:
konrad
2018-06-10 14:14:10 +02:00
committed by kolaente
parent fb4c9d580c
commit f372128784
7 changed files with 167 additions and 6 deletions

View File

@ -122,4 +122,24 @@ func IsErrIDCannotBeZero(err error) bool {
func (err ErrIDCannotBeZero) Error() string {
return fmt.Sprintf("ID cannot be 0")
}
// ===========
// List errors
// ===========
// ErrListDoesNotExist represents a "ErrListDoesNotExist" kind of error. Used if the list does not exist.
type ErrListDoesNotExist struct{
ID int64
}
// IsErrListDoesNotExist checks if an error is a ErrListDoesNotExist.
func IsErrListDoesNotExist(err error) bool {
_, ok := err.(ErrListDoesNotExist)
return ok
}
func (err ErrListDoesNotExist) Error() string {
return fmt.Sprintf("List does not exist [ID: %d]", err.ID)
}