Skip to content

proposal: spec: keys/vals function for map types #7057

Closed
@eaigner

Description

@eaigner
It's quite a common case to use maps to ensure values are unique.

I wondered if the hashmap implementation could expose it's keys and values directly via
a `keys` and `vals` builtin, instead of creating a slices, iterating over the map and
filling the slice. It would also help to avoid creating unnecessary gargabe when only a
reference is obtained.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeLanguageChangeSuggested changes to the Go languagev2An incompatible library change

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions