mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-15 10:12:29 +08:00
fix: fix bug of IsNotNil function
This commit is contained in:
@@ -88,9 +88,9 @@ func (a *Assert) IsNil(v any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IsNotNil check if value is not nil
|
// IsNotNil check if value is not nil
|
||||||
func (a *Assert) IsNotNil(value any) {
|
func (a *Assert) IsNotNil(v any) {
|
||||||
if value == nil {
|
if v == nil || (reflect.ValueOf(v).Kind() == reflect.Ptr && reflect.ValueOf(v).IsNil()) {
|
||||||
makeTestFailed(a.T, a.CaseName, "not nil", value)
|
makeTestFailed(a.T, a.CaseName, "not nil", v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user