fail fails the current test with the given formatted format and args. In case that a test was defined, it uses the test APIs for failing a test, otherwise it uses panic.
(format string, args ...interface{})
| 352 | // In case that a test was defined, it uses the test APIs for failing a test, |
| 353 | // otherwise it uses panic. |
| 354 | func (m *Mock) fail(format string, args ...interface{}) { |
| 355 | m.mutex.Lock() |
| 356 | defer m.mutex.Unlock() |
| 357 | |
| 358 | if m.test == nil { |
| 359 | panic(fmt.Sprintf(format, args...)) |
| 360 | } |
| 361 | m.test.Errorf(format, args...) |
| 362 | m.test.FailNow() |
| 363 | } |
| 364 | |
| 365 | // On starts a description of an expectation of the specified method |
| 366 | // being called. |
no test coverage detected