Open ccoVeille opened 5 months ago
Here is a valid piece of code I have in my code base
There is a function that returns an int32, the tests checks if the value is under the max of int16
Here is the minimum to reproduce the issue
val := int32(42) require.True(t, val <= math.MaxInt16)
The code is autofixed to this
val := int32(42) require.LessOrEqual(t, val, math.MaxInt16)
Which is valid, BUT then require.LessOrEqual will report that val(int32) is not from the same type as math.MaxInt16) (an untyped int)
require.LessOrEqual
math.MaxInt16)
Error: Elements should be the same type
Yes, the code could have been written in a another way, but testifylint provided something that cannot work.
Here is a valid piece of code I have in my code base
There is a function that returns an int32, the tests checks if the value is under the max of int16
Here is the minimum to reproduce the issue
The code is autofixed to this
Which is valid, BUT then
require.LessOrEqual
will report that val(int32) is not from the same type asmath.MaxInt16)
(an untyped int)Yes, the code could have been written in a another way, but testifylint provided something that cannot work.