Antonboom / testifylint

The Golang linter that checks usage of github.com/stretchr/testify.
https://github.com/stretchr/testify
MIT License
101 stars 8 forks source link

false-positive: expected-actual #165

Closed ccoVeille closed 4 months ago

ccoVeille commented 4 months ago

assert.Equal

func Equal(t *testing.T, expected, actual)

Here is a piece of code

https://github.com/gofr-dev/gofr/blob/cd6a321af5bc90f465bd72edfe710e0d8268fff3/pkg/gofr/cmd_test.go#L63-L64

assert.Equal(t, c.Request.Param("param"), "value")
assert.Equal(t, c.Request.Param("b"), "true")

Here is what testifylint suggests

-assert.Equal(t, "value", c.Request.Param("param"))
-assert.Equal(t, "true", c.Request.Param("b"))
+assert.Equal(t, c.Request.Param("param"), "value")
+assert.Equal(t, c.Request.Param("b"), "true")
ccoVeille commented 4 months ago

I'm tired. It works, the diff I got was when I reverted the code