stretchr/testify

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

Open

#570 geöffnet am 7. März 2018

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (1.704 Forks)batch import
help wanted

Repository-Metriken

Stars
 (25.958 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 15h) (2 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide