type checker struct {
foo []any
bar []any
name string
}
func (c *checker) cond(collect *assert.CollectT) {
if c.foo == nil && c.bar == nil {
collect.Errorf("precondition not satisfied")
}
require.NotEmpty(collect, c.name)
}
testifylint reports:
require-error: for error assertions use require
at collect.Errorf.
collect.Errorf reports an error and isn't an error assertion.
Interestingly, it's only reported when there's another testify call in the same scope.
If you remove the require.NotEmpty line, it's not triggered for the collect.Errorf call.
testifylintreports:at
collect.Errorf.collect.Errorfreports an error and isn't an error assertion.Interestingly, it's only reported when there's another testify call in the same scope.
If you remove the
require.NotEmptyline, it's not triggered for thecollect.Errorfcall.