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".

貢獻者指南