-
Notifications
You must be signed in to change notification settings - Fork 2.3k
cmd/deadcode: suppress marker interface method reporting #598
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
Conversation
|
Note: cmd/deadcode/testdata/issue65915.txtar was modified so that deadcode does not erroneously flag the methods as marker methods. This should still maintain the same behavior expectation as reported in golang/go#65915 |
|
This PR (HEAD: bda2c6d) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/710435. Important tips:
|
The deadcode tool now suppresses marker interface methods by default, as these are typically intentional interface implementations rather than dead code. Users can include them in reports using the new -marker flag. Also: in go/ssa/ssautil, Add IsMarkerMethod helper function to identify marker interface methods based on their properties. The function checks that a function: - is unexported - has no parameters beyond the receiver - has no results - has an empty body. Add Marker field to jsonFunction struct to indicate when a function is a marker interface method, allowing users to filter or identify these methods in using the -f template flag. Fixes golang/go#75628
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
bda2c6d to
033c02d
Compare
|
This PR (HEAD: 033c02d) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/710435. Important tips:
|
|
Message from Alan Donovan: Patch Set 3: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
…t of ssautil, cleanup on docs
|
This PR (HEAD: ae0fc95) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/710435. Important tips:
|
|
This PR (HEAD: 75cc227) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/710435. Important tips:
|
|
Message from Filbert Cia: Patch Set 6: (7 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Alan Donovan: Patch Set 6: (6 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
…it, makes isMarkerMethod more concise
|
This PR (HEAD: 109b3ac) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/710435. Important tips:
|
|
Message from Filbert Cia: Patch Set 6: (6 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Alan Donovan: Patch Set 7: Auto-Submit+1 Code-Review+2 Commit-Queue+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 7: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-10-21T17:46:41Z","revision":"9cee034a6bec969697c48070d3db4ef5022e231b"} Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Alan Donovan: Patch Set 7: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 7: This CL has failed the run. Reason: Tryjob golang/try/x_tools-go1.25-darwin-amd64_14 has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 7: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Alan Donovan: Patch Set 8: Auto-Submit+1 Code-Review+2 Commit-Queue+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 8: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-10-21T18:27:52Z","revision":"152c4dcab6d2503953fa9c524b5eb324dd33cb74"} Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Alan Donovan: Patch Set 8: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 8: This CL has failed the run. Reason: Tryjob golang/try/x_tools-gotip-linux-amd64-race has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 8: LUCI-TryBot-Result-1 Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Alan Donovan: Patch Set 8: Commit-Queue+1 TryBot-Bypass+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 8: Dry run: CV is trying the patch. Bot data: {"action":"start","triggered_at":"2025-10-21T18:47:27Z","revision":"152c4dcab6d2503953fa9c524b5eb324dd33cb74"} Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Alan Donovan: Patch Set 8: -Commit-Queue Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
|
Message from Go LUCI: Patch Set 8: This CL has failed the run. Reason: Tryjob golang/try/x_tools-gotip-linux-amd64-race has failed with summary (view all results):
To reproduce, try Additional links for debugging: Please don’t reply on this GitHub thread. Visit golang.org/cl/710435. |
The deadcode tool now suppresses marker interface methods from the default output, as these are typically intentional interface implementations rather than dead code. Marker interface methods are unexported methods that: implement a top-level interface and have no parameters, results, and function body. Add Marker field to jsonFunction struct to indicate when a function is a marker interface method, allowing users to filter or identify these methods in custom format templates. Fixes golang/go#75628 Change-Id: I8271fad800717a96ead18ba9b0f3c4e7b23f864a GitHub-Last-Rev: 109b3ac GitHub-Pull-Request: #598 Reviewed-on: https://go-review.googlesource.com/c/tools/+/710435 Auto-Submit: Alan Donovan <[email protected]> Reviewed-by: David Chase <[email protected]> Reviewed-by: Alan Donovan <[email protected]> TryBot-Bypass: Alan Donovan <[email protected]>
|
This PR is being closed because golang.org/cl/710435 has been merged. |
The deadcode tool now suppresses marker interface methods
from the default output, as these are typically intentional interface
implementations rather than dead code.
Marker interface methods are unexported methods that: implement
a top-level interface and have no parameters, results, and function body.
Add Marker field to jsonFunction struct to indicate when a function
is a marker interface method, allowing users to filter or identify
these methods in custom format templates.
Fixes golang/go#75628