Antonboom / testifylint

The Golang linter that checks usage of github.com/stretchr/testify.
https://github.com/stretchr/testify
MIT License
101 stars 8 forks source link

empty: add Zero(len) and Empty(len) #108

Closed ccoVeille closed 5 months ago

ccoVeille commented 5 months ago

Surprisingly, this pattern is used very often

https://github.com/search?q=language%3Ago+%22assert.Zero%28t%2C+len%22&type=code

            assert.Zero(t, len(result))

https://github.com/search?q=language%3Ago+%22assert.Empty%28t%2C+len%22&type=code

            assert.Empty(t, len(result))

We should suggest using

            assert.Empty(t, result)