Skip to content

feat!: rename Items to Values #12

Description

@millerjp

feat!: rename Items to Values

Summary

The current Items() method on SyncMap[K, V] returns a slice of values, not key-value pairs. Go convention uses "Values" for this operation (maps.Values, stdlib 1.23). Rename to Values() for consistency before the v1.0.0 API is locked. The module path under github.com/axonops/syncmap is pre-v1.0 and a pkg.go.dev search for importers of the new path returns none, so this is a free rename with no compatibility shim required.

Requirements

  1. Rename the method on SyncMap[K, V] from ItemsValues in syncmap.go. Signature and body are otherwise unchanged.
  2. Rewrite the method's godoc comment so it starts with // Values … and describes the return slice as a point-in-time snapshot with O(n) cost (matching the style established by docs: add doc.go and rewrite godoc on every exported symbol #11; if docs: add doc.go and rewrite godoc on every exported symbol #11 has not merged, apply the style here).
  3. Update every Items reference in the test suite to Values:
    • syncmap_test.go (from test: rewrite unit tests to external package with testify/goleak; coverage ≥95% #10): rename the TestItems function to TestValues and each of its subtests (empty_is_emptyempty_is_empty, matchesmatches, length_equals_lenlength_equals_len — names are the same, just attached to the renamed parent).
    • example_test.go: rename ExampleSyncMap_Items to ExampleSyncMap_Values (if example_test.go exists by merge time — feat!: rename Items to Values #12 adds it; this issue updates it if present).
    • syncmap_bench_test.go: rename BenchmarkItems to BenchmarkValues (if present from feat!: rename Items to Values #12).
    • tests/bdd/features/syncmap.feature: rename the Scenario Values slice matches stored entries (or equivalent — scenario names may already use "Values" if written post-rename).
    • tests/bdd/steps/syncmap_steps.go: rename any step function wired to Items.
  4. No other files change. No signature change. No other renames.
  5. Commit message subject uses feat!: prefix and the body explicitly names the old and new symbol.
  6. Add CHANGELOG.md entry under "Breaking" (CHANGELOG ships in feat: add top-level CompareAndSwap and CompareAndDelete functions #14 — this PR amends the v1.0.0 entry whether feat: add top-level CompareAndSwap and CompareAndDelete functions #14 has merged or not).
  7. Add godoc block deprecation note: none — the method is renamed outright, not deprecated.

Acceptance Criteria

  1. grep -nE '\\bfunc.*Items\\b' syncmap.go returns no matches.
  2. grep -nE '\\bfunc.*Values\\b' syncmap.go returns exactly one match, against the SyncMap[K, V] receiver.
  3. git grep -nE '\\bItems\\b' -- syncmap.go syncmap_test.go example_test.go syncmap_bench_test.go tests/bdd/ returns zero matches. (Scope: all production and test files that could carry the old name. String-literal test data for this rename does not exist, so no escape hatch is required.)
  4. go doc github.com/axonops/syncmap Values prints a non-empty doc block that begins with Values and contains the substring O(n).
  5. go doc github.com/axonops/syncmap Items prints nothing (symbol absent).
  6. CHANGELOG.md contains a ## [1.0.0] section with a ### Changed (or ### Breaking) subsection that names ItemsValues as a rename.
  7. Commit subject matches the regex ^feat!: .
  8. make check passes end-to-end; coverage is unchanged or improved by the test rename.
  9. CI on the PR green.

Testing Requirements

Documentation Requirements

Out of Scope

Dependencies

Labels

  • enhancement
  • breaking-change
  • P1

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Important, not blockingbreaking-changeAPI-breaking changeenhancementNew feature or request

    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