{"id":17967245,"url":"https://github.com/mdawar/syncmap","last_synced_at":"2025-07-28T19:36:11.232Z","repository":{"id":258893808,"uuid":"875515651","full_name":"mdawar/syncmap","owner":"mdawar","description":"A simple and generic Go map that is safe for concurrent use.","archived":false,"fork":false,"pushed_at":"2024-10-20T11:49:58.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T09:29:19.311Z","etag":null,"topics":["concurrent-map","go","map","syncmap"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdawar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-20T07:26:26.000Z","updated_at":"2024-10-22T12:57:59.000Z","dependencies_parsed_at":"2024-10-22T05:04:41.844Z","dependency_job_id":null,"html_url":"https://github.com/mdawar/syncmap","commit_stats":null,"previous_names":["mdawar/syncmap"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdawar%2Fsyncmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdawar%2Fsyncmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdawar%2Fsyncmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdawar%2Fsyncmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdawar","download_url":"https://codeload.github.com/mdawar/syncmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247081341,"owners_count":20880412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrent-map","go","map","syncmap"],"created_at":"2024-10-29T14:04:49.169Z","updated_at":"2025-04-03T21:28:13.058Z","avatar_url":"https://github.com/mdawar.png","language":"Go","readme":"# syncmap\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/mdawar/syncmap.svg)](https://pkg.go.dev/github.com/mdawar/syncmap)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mdawar/syncmap)](https://goreportcard.com/report/github.com/mdawar/syncmap)\n[![Tests](https://github.com/mdawar/syncmap/actions/workflows/test.yml/badge.svg)](https://github.com/mdawar/syncmap/actions/workflows/test.yml)\n\nA simple and generic **Go** map that is safe for concurrent use.\n\n## Installation\n\n```sh\ngo get -u github.com/mdawar/syncmap\n```\n\n## Usage\n\n```go\n// Create a map that is safe for concurrent use.\nm := syncmap.New[string, int]()\n\n// Create.\nm.Set(\"a\", 1)\nm.Set(\"b\", 2)\n\n// Get stored value.\nv, ok := m.Get(\"a\")\nfmt.Println(v)  // 1\nfmt.Println(ok) // true\n\n// Delete.\nm.Delete(\"b\")\n\n// Map length.\nm.Len()\n\n// Clear the map (Remove all entries).\nm.Clear()\n\n// Iteration.\nfor k, v := range m.All() {\n  fmt.Println(\"Key\", k, \"/\", \"Value\", v)\n}\n```\n\n```go\n// Create a map with an initial capacity hint.\nm := syncmap.NewWithCapacity[string, int](10_000)\n\n// Equivalent to.\nmake(map[string]int, 10_000)\n```\n\n## Tests\n\n```sh\ngo test -race -cover -vet=all\n# If you have \"just\" installed.\njust test\n# Or using make.\nmake test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdawar%2Fsyncmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdawar%2Fsyncmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdawar%2Fsyncmap/lists"}