Skip to content

refactor(aws/recs): change RecommendationParams pass-by-value to pointer in SP parser functions #1272

Description

@cristim

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions