Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: add examples for Map #20973

Open
kevinburke opened this issue Jul 10, 2017 · 5 comments
Open

sync: add examples for Map #20973

kevinburke opened this issue Jul 10, 2017 · 5 comments
Labels
Documentation help wanted NeedsFix
Milestone

Comments

@kevinburke
Copy link
Contributor

@kevinburke kevinburke commented Jul 10, 2017

It would be nice if there were usage examples for sync.Map, but there are not currently any.

  • Can keys be ordinary values like strings, or should they be custom types, a la context.WithValue?
  • Should I always store a pointer to a value, or can I store a value like a string? If the former how should I do it?
@OneOfOne
Copy link
Contributor

@OneOfOne OneOfOne commented Jul 10, 2017

sync.Map is a wrapper over map[interface{}]interface{}, so the same rules apply but yeah some more documentation would help.

@dsnet
Copy link
Member

@dsnet dsnet commented Jul 10, 2017

\cc @bcmills

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 11, 2017

CL https://golang.org/cl/47990 mentions this issue.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Apr 13, 2018
@ianlancetaylor ianlancetaylor added help wanted NeedsFix labels Apr 13, 2018
@gopherbot
Copy link

@gopherbot gopherbot commented Feb 10, 2019

Change https://golang.org/cl/161722 mentions this issue: sync: add examples for Map, Fixes #20973

@gopherbot
Copy link

@gopherbot gopherbot commented Jul 26, 2021

Change https://golang.org/cl/337390 mentions this issue: sync: add an example for Map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation help wanted NeedsFix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants