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 simplify Zero and Empty compared to []bytes converted into string #112

Closed ccoVeille closed 5 months ago

ccoVeille commented 5 months ago

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

Here are some examples

https://github.com/jroehl/go-suitesync/blob/01764321396a29047cc96ba2c0680c5291993c8c/lib/helper_test.go#L195

        assert.Zero(t, string(res))

https://github.com/testmeifyoucan/schreder/blob/fd29194cd8aacd59e99e2ee91fe36305a7e06fa1/testrunner.go#L203

        return assert.Empty(t, string(responseBody), "expected empty response")

They should be replaced by calling empty

ccoVeille commented 5 months ago

Duplicated by #119