Skip to content

docs: document read and write operations as sync.Map does - #12

Merged
darxnet merged 1 commit into
mainfrom
docs/write-operations
Nov 10, 2026
Merged

darxnet merged 1 commit into
mainfrom
docs/write-operations

Conversation

@darxnet

@darxnet darxnet commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Map promises the concurrency guarantees of sync.Map but never spelled out which calls are read and which are write operations. This adds the paragraph to the Map doc with the wording from Go commit ede4e4f (golang/go#81187): Delete and LoadAndDelete are write operations only when they delete an entry.

A new internal test holds the root lock and checks that Delete, LoadAndDelete and CompareAndDelete of a missing key return without taking it.

Map promises the concurrency guarantees of sync.Map but never spelled
out which calls are read and which are write operations. Add the
paragraph with the wording from Go commit ede4e4f (golang/go#81187):
Delete and LoadAndDelete are writes only when they delete an entry.

A test holds the root lock and checks that deleting a missing key
returns without taking it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@darxnet
darxnet merged commit 036042a into main Nov 10, 2026
9 checks passed
@darxnet
darxnet deleted the docs/write-operations branch November 10, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant