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 · May be fixed by #30152

Comments

@kevinburke
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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.

@ucirello

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2017

I'd like to work on this example. I shall be opening a CL about it soon.

@dsnet

This comment has been minimized.

Copy link
Member

commented Jul 10, 2017

\cc @bcmills

@gopherbot

This comment has been minimized.

Copy link

commented Jul 11, 2017

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

@gopherbot

This comment has been minimized.

Copy link

commented Feb 10, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.