chore: Enable `unparam` linter and cover unused `*Response` results by ManavSharma142 · Pull Request #3955 · google/go-github

@ManavSharma142

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.

@ManavSharma142

@google-cla

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

@ManavSharma142

@ManavSharma142

@ManavSharma142

@ManavSharma142

@codecov

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (f32f05e) to head (172ef8f).
⚠️ Report is 4 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.

gmlewis

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

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

gmlewis

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.

Not-Dhananjay-Mishra

@ManavSharma142

alexandear

Not-Dhananjay-Mishra

Choose a reason for hiding this comment

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

LGTM

@gmlewis