Skip to content

sync: add Map.CompareAndSwap and Map.CompareAndDelete#5394

Merged
dgryski merged 1 commit into
tinygo-org:devfrom
jakebailey:fix-3754
May 11, 2026
Merged

sync: add Map.CompareAndSwap and Map.CompareAndDelete#5394
dgryski merged 1 commit into
tinygo-org:devfrom
jakebailey:fix-3754

Conversation

@jakebailey
Copy link
Copy Markdown
Member

Fixes #3754

I forgot to send this PR yesterday and remembered when I read #5386 (comment)

These methods were added in Go 1.20 but were missing from TinyGo's
sync.Map implementation, causing compilation failures for code that
uses them.

The implementation follows the same lock-based approach as the rest
of TinyGo's sync.Map.
Copy link
Copy Markdown
Member

@dgryski dgryski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dgryski dgryski merged commit 4204f3d into tinygo-org:dev May 11, 2026
19 checks passed
@jakebailey jakebailey deleted the fix-3754 branch May 11, 2026 21:38
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.

type *sync.Map has no field or method CompareAndDelete

2 participants