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
{{ message }}
Repository navigation
refactor(aws/recs): change RecommendationParams pass-by-value to pointer in SP parser functions #1272
5 functions in providers/aws/recommendations/parser_sp.go take params common.RecommendationParams by value. RecommendationParams is ~200 bytes (5 string fields + 5 slice fields), triggering gocritic hugeParam warnings. These functions are all read-only users of params.
Affected functions
getSavingsPlansRecommendations
fetchSPAllPages
parseSavingsPlansRecommendations
parseSavingsPlanDetail
planTypesForParams
Fix
Change each to accept params *common.RecommendationParams (pointer) and update all callers, including test files. Also audit coverage.go and utilization.go for the same pattern.
Deferred from PR #865 to keep scope focused on the race fix. Currently suppressed with //nolint:gocritic comments.
Notes
All callers currently pass params by value (local variable), so the change is mechanical
No semantic change; read-only pointer access is equivalent
Verification sweep against main (101f099fb) on 2026-07-27 finds this already resolved.
parser_sp.go: all five functions now take params *common.RecommendationParams.
Evidence: providers/aws/recommendations/parser_sp.go.
Recommending close.
Verified resolved at 3c0f8ac: getSavingsPlansRecommendations, fetchSPAllPages, parseSavingsPlansRecommendations, parseSavingsPlanDetail and planTypesForParams all take params *common.RecommendationParams, and the //nolint:gocritic suppressions are gone. Evidence: providers/aws/recommendations/parser_sp.go:31,94,170,298,408 (1d9f1b8, PR #865). Residual axes checked: coverage.go and utilization.go were audited as the issue asked and carry no RecommendationParams parameter at all; parser_ri.go:18,44 still pass by value, but those two functions are outside this issue's stated scope and are worth a separate issue if the hugeParam class is being swept. Closing as completed; reopen if the behaviour recurs.
Activity
cristim commentedon Jul 27, 2026
Verification sweep against
main(101f099fb) on 2026-07-27 finds this already resolved.parser_sp.go: all five functions now take
params *common.RecommendationParams.Evidence: providers/aws/recommendations/parser_sp.go.
Recommending close.
cristim commentedon Sep 2, 2026
Verified resolved at 3c0f8ac: getSavingsPlansRecommendations, fetchSPAllPages, parseSavingsPlansRecommendations, parseSavingsPlanDetail and planTypesForParams all take params *common.RecommendationParams, and the //nolint:gocritic suppressions are gone. Evidence: providers/aws/recommendations/parser_sp.go:31,94,170,298,408 (1d9f1b8, PR #865). Residual axes checked: coverage.go and utilization.go were audited as the issue asked and carry no RecommendationParams parameter at all; parser_ri.go:18,44 still pass by value, but those two functions are outside this issue's stated scope and are worth a separate issue if the hugeParam class is being swept. Closing as completed; reopen if the behaviour recurs.