stretchr/testify

assert: NotNil accepts non-nillable types and doesn't fail

Open

#570 创建于 2018年3月7日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)Go (25,958 star) (1,704 fork)batch import
help wanted

描述

https://github.com/stretchr/testify/blob/b89eecf5ca5db6d3ba60b237ffe3df7bafb7662f/assert/assertions.go#L390-L410

isNil will always return false, so NotNil will always return true for int, string, struct, etc.

I would expect it to error with "invalid type".

贡献者指南

assert: NotNil accepts non-nillable types and doesn't fail · stretchr/testify#570 | Good First Issue