golang/go

sync: add examples for Map

Open

#20 973 ouverte le 10 juil. 2017

Voir sur GitHub
 (5 commentaires) (2 réactions) (0 assignés)Go (19 008 forks)batch import
DocumentationNeedsFixcompiler/runtimehelp wanted

Métriques du dépôt

Stars
 (133 883 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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?

Guide contributeur