operator, orca, playpen: delete unreferenced helpers - #681
Open
Philip Lombardi (plombardi89) wants to merge 1 commit into
Open
operator, orca, playpen: delete unreferenced helpers#681Philip Lombardi (plombardi89) wants to merge 1 commit into
Philip Lombardi (plombardi89) wants to merge 1 commit into
Conversation
operator:
- component.ApplyOperations and ExecutionResult.Dropped have no reference.
- override.ProblemsErr and override.AnyKeyLevel likewise; ProblemsErr was the
package's only use of the errors import.
override.PermittedPaths, override.ProtectedPaths and override.ValidateErr are
reported by `make deadcode` without -test and are kept. They are called from
override_examples_test.go, which compares the documented allowlist against the
declared one, so they are the mechanism that keeps the docs honest rather than
leftovers from a deleted caller.
orca:
- app.WithSkipCachestoreSelfTest set a skipCacheSelfTest field that nothing
else ever set, which made the branch it guarded unreachable and the
cachestore self-test unconditional in every configuration including the
integration harness. The option, the field and the dead branch go, and the
self-test now reads as the single path it already was. The struct comment
that advertised the escape hatch is corrected.
- inttest loses four harness affordances with no caller: AllBlobs,
Azurite.UploadPageBlob (the file's only use of the azblob blob, container
and pageblob packages), CountingInternalHandlerWrap.CountAcross and
CountingOrigin.Heads.
The seven remaining app.WithX options and cluster.WithPeerSource /
WithHTTPClient are dead in the default configuration and live under
integrationtest, so they stay. That difference is exactly why `make deadcode`
scans both tag sets.
playpen: Playpen.WireGuardPrivateKey had no caller. The AllocateOptions field of
the same name is unaffected and still read.
Refs #670
This was referenced Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the #670 dead-code sweep, split by component. The tooling that produced these findings is #673; this PR is deletions only and is independent of the other eight — the file sets are disjoint, so they can be reviewed and merged in any order and in parallel.
Why two analyzers were needed to find this
unusedcannot see dead exported code underinternal/. That is a documented design decision, not a gap:unused/unused.go:48-62holds that a package uses its exported named types and a named type uses its exported methods, so every method on an exported type is transitively live because the type is exported.x/tools/cmd/deadcodedoes not close that gap on its own either.x/tools/go/callgraph/rta/rta.go:281-287,433-437— converting a value to an interface materializes its runtime type and marks every exported method of that type reachable, because reflection could call any of them. Onevar i any = xanywhere buys all ofx's exported methods a clean bill of health.So #673 adds both
deadcodeandhack/cmd/unreferenced, which resolves identifiers instead of tracing reachability. Neither subsumes the other, and findings below are attributed to whichever one saw them.operator, orca, playpen: delete unreferenced helpers
operator:
package's only use of the errors import.
override.PermittedPaths, override.ProtectedPaths and override.ValidateErr are
reported by
make deadcodewithout -test and are kept. They are called fromoverride_examples_test.go, which compares the documented allowlist against the
declared one, so they are the mechanism that keeps the docs honest rather than
leftovers from a deleted caller.
orca:
else ever set, which made the branch it guarded unreachable and the
cachestore self-test unconditional in every configuration including the
integration harness. The option, the field and the dead branch go, and the
self-test now reads as the single path it already was. The struct comment
that advertised the escape hatch is corrected.
Azurite.UploadPageBlob (the file's only use of the azblob blob, container
and pageblob packages), CountingInternalHandlerWrap.CountAcross and
CountingOrigin.Heads.
The seven remaining app.WithX options and cluster.WithPeerSource /
WithHTTPClient are dead in the default configuration and live under
integrationtest, so they stay. That difference is exactly why
make deadcodescans both tag sets.
playpen: Playpen.WireGuardPrivateKey had no caller. The AllocateOptions field of
the same name is unaffected and still read.
Refs #670
Verification
go build ./...,go vet ./...,golangci-lintover the touched trees (0 issues),make fmtproducing no diff, andgo build -tags e2e,integrationtest,storageboundary ./.... Full suite runs in CI.The eight deletion branches were reassembled onto the tooling commits and diffed against the original combined branch: byte-identical, so nothing was lost or duplicated in the split.