stretchr/testify

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

Open

#570 aberto em 7 de mar. de 2018

Ver no GitHub
 (4 comments) (0 reactions) (0 assignees)Go (1.704 forks)batch import
help wanted

Métricas do repositório

Stars
 (25.958 stars)
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