Return value in Nil if not nil

This commit is contained in:
Nise Void 2019-04-17 11:14:06 +02:00
parent 34643d9853
commit 4d3d17dd62
Signed by: NiseVoid
GPG Key ID: FBA14AC83EA602F3

View File

@ -65,7 +65,7 @@ func isNil(val interface{}) bool {
// Nil asserts the given value is nil // Nil asserts the given value is nil
func (a Assert) Nil(actual interface{}, msg ...interface{}) { func (a Assert) Nil(actual interface{}, msg ...interface{}) {
t(a).Helper() t(a).Helper()
msg = prepMsg(msg, `Should be nil, but it isn't`) msg = prepMsg(msg, `Should be nil, but got %#v`, actual)
a(isNil(actual), msg...) a(isNil(actual), msg...)
} }