-
With master version of testifylint, with (Example from https://github.com/kubernetes/kubernetes/pull/127649/files) assert.Error(t, err, fmt.Sprintf("Profile %s should not be valid", test.profile)) The suggestion is assert.Error(t, err, "Profile %s should not be valid", test.profile) But I expect assert.Errorf(t, err, "Profile %s should not be valid", test.profile) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@mmorel-35 hi! did you use (disabled by default to avoid a lot of changes in large codebases, read the checker docs) |
Beta Was this translation helpful? Give feedback.
-
With While with : assert.Error(t, err, "Profile should not be valid") I don't expect to have assert.Errorf(t, err, "Profile should not be valid") but with: assert.Error(t, err, "Profile %s should not be valid", test.profile) I expect assert.Errorf(t, err, "Profile %s should not be valid", test.profile) |
Beta Was this translation helpful? Give feedback.
-
Your expectations are invalid. By Go convention f-suffix is triggered by any message, without arguments too. |
Beta Was this translation helpful? Give feedback.
Your expectations are invalid.
Please, read the checker doc carefully, including historical reference.
By Go convention f-suffix is triggered by any message, without arguments too.
Look at
fmt.Sprint
andfmt.Sprintf
signatures for example.