stretchr/testify

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

Aberta

#570 aberto em 7 de mar. de 2018

 (4 comentários) (0 reação) (0 responsável)Go (1.704 forks)batch import
help wanted

Métricas do repositório

Stars
 (25.958 estrelas)
Métricas de merge de PR
 (Mesclagem média 6d 15h) (2 fundiu PRs em 30d)

Description

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

Guia do colaborador