staskobzar /
goagi
| 1 | package goagi |
||
| 2 | |||
| 3 | import "fmt" |
||
| 4 | |||
| 5 | type Error struct { |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 6 | s string |
||
| 7 | e string |
||
| 8 | } |
||
| 9 | |||
| 10 | func newError(ctx string) *Error { |
||
| 11 | return &Error{s: ctx} |
||
| 12 | } |
||
| 13 | |||
| 14 | func (e *Error) Msg(msg string, args ...interface{}) error { |
||
|
0 ignored issues
–
show
|
|||
| 15 | e.e = fmt.Sprintf(msg, args...) |
||
|
0 ignored issues
–
show
|
|||
| 16 | return e |
||
| 17 | } |
||
| 18 | |||
| 19 | func (e *Error) Error() string { |
||
| 20 | return fmt.Sprintf("%s: %s", e.s, e.e) |
||
| 21 | } |
||
| 22 |