Method di Package Testing
func (c *common) Fail() {
if c.parent != nil {
c.parent.Fail()
}
c.mu.Lock()
defer c.mu.Unlock()
// c.done needs to be locked to synchronize checks to c.done in parent tests.
if c.done {
panic("Fail in goroutine after " + c.name + " has completed")
}
c.failed = true
}func (c *common) FailNow() {
c.checkFuzzFn("FailNow")
c.Fail()
// ...
c.mu.Lock()
c.finished = true
c.mu.Unlock()
runtime.Goexit()
}Contoh code
Implementasi method Error
Implementasi method Fatal
Implementasi method Skip
Last updated