go-tools
go-tools copied to clipboard
SA4000: doesn't work on functions returning interfaces
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.