Skip to content

Establish ownership/copying convention for shared maps #344

Open

Description

@mclasmeier

Raised by @porridge in #339 (comment):

getCentralResourcesOperator returns a shared static map. Callers that pass it into mergo.Merge (which mutates the destination) must deep-copy first to avoid corrupting the shared data. There's no documented convention for who is responsible for copying.

Should we adopt a style guideline — e.g. "functions returning shared maps must return copies" or "callers must always copy before mutating"?

— Created by AI agent on behalf of @mclasmeier

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions