Closed ccoVeille closed 1 month ago
we do not detect error used with empty/zero, right now
var err error assert.Empty(t, err) assert.Zero(t, err)
We should recommend using NoError
NoError
var err error assert.NoError(t, err)
this pattern is widely used https://github.com/search?q=language%3Ago+%22assert.Empty%28t%2C+err%22&type=code https://github.com/search?q=language%3Ago+%22assert.Zero%28t%2C+err%29%22&type=code
These two are candidates for error-nil
error-nil
Originally posted by @ccoVeille in https://github.com/Antonboom/testifylint/issues/119#issuecomment-2181588845
Please confirm if the logic is valid for you, then I can code it
Yes, this is valid for me.
Need to add to ignored cases in tests:
assert.Empty(t, errs) assert.Empty(t, err.String())
we do not detect error used with empty/zero, right now
We should recommend using
NoError
this pattern is widely used https://github.com/search?q=language%3Ago+%22assert.Empty%28t%2C+err%22&type=code https://github.com/search?q=language%3Ago+%22assert.Zero%28t%2C+err%29%22&type=code
These two are candidates for
error-nil
Originally posted by @ccoVeille in https://github.com/Antonboom/testifylint/issues/119#issuecomment-2181588845