You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #936 (walker migration). Surfaced while reviewing the still-exported primitives.
Observation
The three Check*PropertiesDiff helpers in checker/checks-utils.go are exported but have zero external callers:
Symbol
Defined
External callers (checker.X references)
CheckModifiedPropertiesDiff
checker/checks-utils.go:68
0
CheckAddedPropertiesDiff
checker/checks-utils.go:173
0
CheckDeletedPropertiesDiff
checker/checks-utils.go:276
0
Verified with grep -rln "checker\.Check\(Modified\|Added\|Deleted\)PropertiesDiff" across the repo — no hits outside checker/ itself.
Inside checker/, CheckModifiedPropertiesDiff has 30 call sites today, including the walker's own walkProperties helper (media_type_walker.go). As batches of #936 migrate checkers from direct CheckModifiedPropertiesDiff calls to info.walkProperties, the direct-call count shrinks. After the migration completes, the only remaining caller is walkProperties itself, in the same package.
CheckAddedPropertiesDiff and CheckDeletedPropertiesDiff have fewer direct callers (a handful of checkers, e.g. check_response_required_property_updated.go), and the walker does not yet wrap them.
Add walkAddedProperties and walkDeletedProperties siblings to media_type_walker.go. Same shape as walkProperties but wrapping the Added / Deleted primitives. Migrate the few checkers that currently need the other two (e.g. check_response_required_property_updated.go).
Single mechanical commit (one find/replace + go test).
End state
The checker package's exported surface around property walking shrinks to just walkProperties / walkAddedProperties / walkDeletedProperties (which remain unexported, accessed via the mediaTypeInfo receiver), plus the higher-level public entry points (CheckBackwardCompatibility… and the per-rule Check… functions). The primitive Check*PropertiesDiff helpers move out of the public API where they were only ever placeholder exports for now-defunct external callers.
Acceptance
All un-migrated checkers use info.walkProperties (or the new walkAdded* / walkDeleted* siblings). Direct Check*PropertiesDiff call sites = 3 (one per primitive, called from the walker only).
walkAddedProperties and walkDeletedProperties exist on mediaTypeInfo, mirroring walkProperties.
Three primitives renamed to lowercase.
Public surface check: grep -rn '^func Check\(Modified\|Added\|Deleted\)PropertiesDiff' checker/*.go returns nothing.
Full test suite green; no behavioural change.
Sequencing note
This is a strictly mechanical follow-up that lands cleanly only once the bulk migration is done. Filing now so the cleanup doesn't get forgotten when the last batch of #936 merges.
Follow-up to #936 (walker migration). Surfaced while reviewing the still-exported primitives.
Observation
The three
Check*PropertiesDiffhelpers inchecker/checks-utils.goare exported but have zero external callers:checker.Xreferences)CheckModifiedPropertiesDiffchecker/checks-utils.go:68CheckAddedPropertiesDiffchecker/checks-utils.go:173CheckDeletedPropertiesDiffchecker/checks-utils.go:276Verified with
grep -rln "checker\.Check\(Modified\|Added\|Deleted\)PropertiesDiff"across the repo — no hits outsidechecker/itself.Inside
checker/,CheckModifiedPropertiesDiffhas 30 call sites today, including the walker's ownwalkPropertieshelper (media_type_walker.go). As batches of #936 migrate checkers from directCheckModifiedPropertiesDiffcalls toinfo.walkProperties, the direct-call count shrinks. After the migration completes, the only remaining caller iswalkPropertiesitself, in the same package.CheckAddedPropertiesDiffandCheckDeletedPropertiesDiffhave fewer direct callers (a handful of checkers, e.g.check_response_required_property_updated.go), and the walker does not yet wrap them.Proposal
A small endgame on top of the existing migration:
Finish migrating the remaining ~23 checkers off direct
CheckModifiedPropertiesDiffcalls — already in flight as part of checker: extract a media-type walker to dedupe the per-checker traversal prelude #936 (batches PR-5 through PR-9 merged so far; ~25 files left).Add
walkAddedPropertiesandwalkDeletedPropertiessiblings tomedia_type_walker.go. Same shape aswalkPropertiesbut wrapping the Added / Deleted primitives. Migrate the few checkers that currently need the other two (e.g.check_response_required_property_updated.go).Rename and unexport the three primitives:
CheckModifiedPropertiesDiff→checkModifiedPropertiesDiffCheckAddedPropertiesDiff→checkAddedPropertiesDiffCheckDeletedPropertiesDiff→checkDeletedPropertiesDiffSingle mechanical commit (one find/replace + go test).
End state
The
checkerpackage's exported surface around property walking shrinks to justwalkProperties/walkAddedProperties/walkDeletedProperties(which remain unexported, accessed via themediaTypeInforeceiver), plus the higher-level public entry points (CheckBackwardCompatibility…and the per-ruleCheck…functions). The primitiveCheck*PropertiesDiffhelpers move out of the public API where they were only ever placeholder exports for now-defunct external callers.Acceptance
info.walkProperties(or the newwalkAdded*/walkDeleted*siblings). DirectCheck*PropertiesDiffcall sites = 3 (one per primitive, called from the walker only).walkAddedPropertiesandwalkDeletedPropertiesexist onmediaTypeInfo, mirroringwalkProperties.grep -rn '^func Check\(Modified\|Added\|Deleted\)PropertiesDiff' checker/*.goreturns nothing.Sequencing note
This is a strictly mechanical follow-up that lands cleanly only once the bulk migration is done. Filing now so the cleanup doesn't get forgotten when the last batch of #936 merges.