Skip to content

refactor: Remove redundant github.Ptr calls#4145

Open
alexandear wants to merge 1 commit intogoogle:masterfrom
alexandear-org:refactor/redundantptr
Open

refactor: Remove redundant github.Ptr calls#4145
alexandear wants to merge 1 commit intogoogle:masterfrom
alexandear-org:refactor/redundantptr

Conversation

@alexandear
Copy link
Copy Markdown
Contributor

This PR adds redundantptr linter to detect github.Ptr(x) calls that can be replaced with simple &x.

@gmlewis gmlewis changed the title refactor: Remove redundant github.Ptr calls refactor: Remove redundant github.Ptr calls Apr 9, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.69%. Comparing base (5124fac) to head (005c343).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
example/commitpr/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4145      +/-   ##
==========================================
- Coverage   93.74%   93.69%   -0.05%     
==========================================
  Files         211      210       -1     
  Lines       19685    18999     -686     
==========================================
- Hits        18453    17801     -652     
+ Misses       1034     1012      -22     
+ Partials      198      186      -12     

☔ 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 gmlewis added the NeedsReview PR is awaiting a review before merging. label Apr 10, 2026
},
},
LastActiveOn: Ptr(lastActiveOn),
LastActiveOn: Ptr(Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please revert all changes to github/actions_hosted_runners_test.go as I would consider this a regression in terms of readability. Having a single lastActiveOn variable is much easier to read and understand than having to look at each argument to see if the timestamps are the same and then trying to figure out why a single value was not OK to use here.

If you have to add exceptions to your linter, then I think that is what needs to be done.

},
},
LastActiveOn: Ptr(lastActiveOn),
LastActiveOn: Ptr(Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here

},
},
LastActiveOn: Ptr(lastActiveOn),
LastActiveOn: Ptr(Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here

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.

2 participants