This commit is contained in:
23
test/require/error.go
Normal file
23
test/require/error.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package require
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func NoError(t *testing.T, err error, msgAndArgs ...interface{}) {
|
||||
t.Helper()
|
||||
|
||||
if err != nil {
|
||||
t.Error(msgAndArgs...)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func NoErrorf(t *testing.T, err error, msg string, args ...interface{}) {
|
||||
t.Helper()
|
||||
|
||||
if err != nil {
|
||||
t.Errorf(msg, args...)
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user