Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect TestingT.Errorf usage and enable linting for this #2182

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

denik
Copy link
Contributor

@denik denik commented Jan 20, 2025

Changes

  • Fix incorrect use Errorf on literal string. This resulted in garbage output in tests diagnostics where % was replaced by "(MISSING)".
  • Enable linter on testingT.Errorf.

Note, the autofix by the linter is wrong, it proposes t.Errorf("%s", string) but it should be t.Error(string). That can corrected manually though.

Tests

Linter was tested manually by reverting the fix on Errorf.

- Fix incorrect use Errorf on literal string. This resulted
  in garbage output in tests diagnostics where % was replaced by "(MISSING)".
- Enable linter on testingT.Errorf.

Note, the autofix by the linter is wrong, it wants to use Errorf("%s", string),
instead of Error(string) but that can corrected manually.
@denik denik enabled auto-merge January 20, 2025 07:51
@denik denik added this pull request to the merge queue Jan 20, 2025
Merged via the queue into main with commit 26f527e Jan 20, 2025
9 checks passed
@denik denik deleted the denik/testingT-Errorf branch January 20, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants