Skip to content

Conversation

@ManavSharma142
Copy link

Fixes : #3953
I enabled the unparam linter for exported results and exercised previously unused *Response return values in tests.
For the 9 affected methods, I added testNewRequestAndDoFailure blocks to ensure the *Response path is covered.

I also updated the CI config to enable:
unparam:
check-exported: true
and modified apps_test.go accordingly.

@google-cla
Copy link

google-cla bot commented Feb 1, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ManavSharma142
Copy link
Author

signed

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Feb 1, 2026
@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (f32f05e) to head (d8adb5d).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3955      +/-   ##
==========================================
+ Coverage   92.45%   92.51%   +0.05%     
==========================================
  Files         203      203              
  Lines       14980    14980              
==========================================
+ Hits        13850    13858       +8     
+ Misses        927      923       -4     
+ Partials      203      199       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @ManavSharma142!
This is very interesting and is actually highlighting a number of problems:

  1. testBadOptions doesn't need to be within any table-driven tests
  2. testBadOptions only needs to be called once per endpoint, with newlines for args
  3. methodName should always be shared between testBadOptions and testNewRequestAndDoFailure
  4. Some tests that actually take string arguments appear to be missing a testBadOptions call

Could you please investigate these issues in this repo, @ManavSharma142?

@ManavSharma142
Copy link
Author

Thank you, @ManavSharma142!
This is very interesting and is actually highlighting a number of problems:

  1. testBadOptions doesn't need to be within any table-driven tests
  2. testBadOptions only needs to be called once per endpoint, with newlines for args
  3. methodName should always be shared between testBadOptions and testNewRequestAndDoFailure
  4. Some tests that actually take string arguments appear to be missing a testBadOptions call

Could you please investigate these issues in this repo, @ManavSharma142?

I believe a separate issue/pr is warranted, since this requires extensive refactoring across all test functions.

@gmlewis gmlewis changed the title chore: Enable unparam linter and cover unused *Response results chore: Enable unparam linter and cover unused *Response results Feb 1, 2026
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @ManavSharma142!
LGTM.
Awaiting second LGTM+Approval from any other contribitor to this repo before merging.

- commentFormatting
- deprecatedComment
- paramTypeCombine
unparam:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency can we place it after staticcheck (Alphabetical order)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some *Response return values are not covered by tests

3 participants