-
Notifications
You must be signed in to change notification settings - Fork 2.3k
cmd/deadcode: suppress marker interface method reporting by default #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
base: master
Are you sure you want to change the base?
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:
|
The deadcode tool now suppresses marker interface methods
from the default output, as these are typically intentional interface
implementations rather than dead code. Users can include them in
reports using the new -marker flag.
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