refactor: Remove redundant github.Ptr calls#4145
refactor: Remove redundant github.Ptr calls#4145alexandear wants to merge 2 commits intogoogle:masterfrom
github.Ptr calls#4145Conversation
github.Ptr calls
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4145 +/- ##
==========================================
- Coverage 93.74% 93.70% -0.04%
==========================================
Files 211 210 -1
Lines 19685 18996 -689
==========================================
- Hits 18453 17801 -652
+ Misses 1034 1009 -25
+ Partials 198 186 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @alexandear!
Just one file deletion, then LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode
| @@ -0,0 +1,10 @@ | |||
| // Copyright 2026 The go-github AUTHORS. All rights reserved. | |||
There was a problem hiding this comment.
I think this file can be completely deleted.
There was a problem hiding this comment.
We can't remove this file because it's used in tests:
❯ go test ./...
--- FAIL: TestRun (0.16s)
analysistest.go:417: src/has-warnings/main.go:9:2: cannot find package "github.com/google/go-github/v84/github" in any of:
/opt/homebrew/Cellar/go/1.26.2/libexec/src/github.com/google/go-github/v84/github (from $GOROOT)
/Users/alexandear/src/github.com/google/go-github/tools/redundantptr/testdata/src/github.com/google/go-github/v84/github (from $GOPATH)
analysistest.go:417: /Users/alexandear/src/github.com/google/go-github/tools/redundantptr/testdata/src/has-warnings/main.go:9:2: could not import github.com/google/go-github/v84/github (invalid package name: "")
analysistest.go:417: /Users/alexandear/src/github.com/google/go-github/tools/redundantptr/testdata/src/no-warnings/main.go:8:8: could not import github.com/google/go-github/v84/github (invalid package name: "")
analysistest.go:431: error analyzing redundantptr@has-warnings: analysis skipped due to errors in package
analysistest.go:431: error analyzing redundantptr@no-warnings: analysis skipped due to errors in package
FAIL
FAIL tools/redundantptr 0.379s
FAILThe analysistest framework needs the imported packages to be available in the testdata directory structure.
This PR adds
redundantptrlinter to detectgithub.Ptr(x)calls that can be replaced with simple&x.