Skip to content

Instantly share code, notes, and snippets.

@madflojo
Created September 3, 2022 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madflojo/d910f4a72e666068f2310f088f0f3583 to your computer and use it in GitHub Desktop.
Save madflojo/d910f4a72e666068f2310f088f0f3583 to your computer and use it in GitHub Desktop.
ThreadSafe Packages
// Directory provides the ability to store and lookup people.
type Directory struct {
sync.RWMutex
// directory stores known People
directory map[string]Person
// name is used to identify the Directory instance
name string
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment