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
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@kevinburke
Copy link
Contributor

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

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 commented Jul 10, 2017

\cc @bcmills

@gopherbot
Copy link

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 The path to resolution is known, but the work has not been done. labels Apr 13, 2018
@gopherbot
Copy link

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

@gopherbot
Copy link

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

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants