golang/go

sync: add examples for Map

Open

#20.973 aperta il 10 lug 2017

Vedi su GitHub
 (5 commenti) (2 reazioni) (0 assegnatari)Go (19.008 fork)batch import
DocumentationNeedsFixcompiler/runtimehelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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?

Guida contributor