Skip to content
Snippets Groups Projects

Resolve "There are two defined errors (ErrNotFound and ErrCouldNotFind) which represent the same issue"

3 files
+ 5
5
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -182,12 +182,12 @@ func (e ErrCouldNotUpdate) Error() string {
@@ -182,12 +182,12 @@ func (e ErrCouldNotUpdate) Error() string {
// ErrCouldNotFind implements the Error interface and is called if a
// ErrCouldNotFind implements the Error interface and is called if a
// stored item can not be found.
// stored item can not be found.
type ErrCouldNotFind struct {
type ErrCouldNotFind struct {
ID interface{}
ID any
Name interface{}
Name string
}
}
func (e ErrCouldNotFind) Error() string {
func (e ErrCouldNotFind) Error() string {
return fmt.Sprintf("ID: %v or Name: %vnot found", e.ID, e.Name)
return fmt.Sprintf("ID: %v or Name: %v not found", e.ID, e.Name)
}
}
// ErrCouldNotCreate implements the Error interface and is called if a
// ErrCouldNotCreate implements the Error interface and is called if a
// stored item can not be found.
// stored item can not be found.
type ErrCouldNotCreate struct {
type ErrCouldNotCreate struct {
StoreName string
StoreName string
}
}
Loading