(format string, a ...interface{})
| 43 | } |
| 44 | |
| 45 | func NewErrorf(format string, a ...interface{}) error { |
| 46 | msg := fmt.Sprintf(format, a...) |
| 47 | _, file, line, _ := runtime.Caller(1) |
| 48 | _, fileName := path.Split(file) |
| 49 | |
| 50 | return &ErrorTrace{ |
| 51 | msg: fmt.Sprintf("[%v %v] %v", fileName, line, msg), |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | func (e *ErrorTrace) Error() string { |
| 56 | return e.msg |
no test coverage detected