4 changed files with 22 additions and 18 deletions
@ -1,26 +1,30 @@ |
|||
package sorted |
|||
|
|||
import ( |
|||
"fmt" |
|||
"gitlab.com/Pixdigit/uniqueID" |
|||
) |
|||
|
|||
//List is empty
|
|||
type ErrListEmpty struct { |
|||
S string |
|||
} |
|||
|
|||
func (err ErrListEmpty) Error() string { |
|||
return err.S |
|||
return "list is empty" |
|||
} |
|||
|
|||
type ErrDuplicateElem struct { |
|||
S string |
|||
DuplicateID uniqueID.ID |
|||
} |
|||
|
|||
func (err ErrDuplicateElem) Error() string { |
|||
return err.S |
|||
return fmt.Sprint("Duplicate element with ID = ", err.DuplicateID) |
|||
} |
|||
|
|||
type ErrNoElem struct { |
|||
S string |
|||
MissingID uniqueID.ID |
|||
} |
|||
|
|||
func (err ErrNoElem) Error() string { |
|||
return err.S |
|||
return fmt.Sprint("no element with ID =", err.MissingID) |
|||
} |
|||
|
Loading…
Reference in new issue