Problem
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
Problem
5 functions in
providers/aws/recommendations/parser_sp.gotakeparams common.RecommendationParamsby value.RecommendationParamsis ~200 bytes (5 string fields + 5 slice fields), triggering gocritichugeParamwarnings. These functions are all read-only users ofparams.Affected functions
getSavingsPlansRecommendationsfetchSPAllPagesparseSavingsPlansRecommendationsparseSavingsPlanDetailplanTypesForParamsFix
Change each to accept
params *common.RecommendationParams(pointer) and update all callers, including test files. Also auditcoverage.goandutilization.gofor the same pattern.Deferred from PR #865 to keep scope focused on the race fix. Currently suppressed with
//nolint:gocriticcomments.Notes
paramsby value (local variable), so the change is mechanical