go-tools icon indicating copy to clipboard operation
go-tools copied to clipboard

SA4000: doesn't work on functions returning interfaces

Open dominikh opened this issue 3 years ago • 0 comments

This currently doesn't get flagged:

if errors.New("abc") == errors.New("abc") {}

This used to work, but we broke it when we added support for generics. We don't want to flag unconstrained type parameters, because they might be floats. errors.New returns an interface, and we incorrectly apply the same check to interfaces that we apply to type parameters.

dominikh avatar Jun 28 '22 14:06 dominikh