stretchr/testify

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

Ouverte

#570 ouverte le 7 mars 2018

 (4 commentaires) (0 réaction) (0 personne assignée)Go (1 704 forks)batch import
help wanted

Métriques du dépôt

Stars
 (25 958 étoiles)
Métriques de merge PR
 (Merge moyen 6j 15h) (2 PRs mergées en 30 j)

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

Guide contributeur