{"id":16694738,"url":"https://github.com/spenserblack/go-defaultmap","last_synced_at":"2025-09-09T01:33:21.408Z","repository":{"id":38227968,"uuid":"501359321","full_name":"spenserblack/go-defaultmap","owner":"spenserblack","description":"A map with default values","archived":false,"fork":false,"pushed_at":"2022-06-08T19:42:38.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T01:32:46.970Z","etag":null,"topics":["default","defaultmap","generics","go","golang","map"],"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/spenserblack.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}},"created_at":"2022-06-08T18:03:38.000Z","updated_at":"2022-06-08T19:48:11.000Z","dependencies_parsed_at":"2022-08-18T08:11:32.865Z","dependency_job_id":null,"html_url":"https://github.com/spenserblack/go-defaultmap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/spenserblack/go-defaultmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spenserblack%2Fgo-defaultmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spenserblack%2Fgo-defaultmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spenserblack%2Fgo-defaultmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spenserblack%2Fgo-defaultmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spenserblack","download_url":"https://codeload.github.com/spenserblack/go-defaultmap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spenserblack%2Fgo-defaultmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274232026,"owners_count":25245856,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["default","defaultmap","generics","go","golang","map"],"created_at":"2024-10-12T16:48:04.668Z","updated_at":"2025-09-09T01:33:21.357Z","avatar_url":"https://github.com/spenserblack.png","language":"Go","readme":"# defaultmap\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/spenserblack/go-defaultmap.svg)](https://pkg.go.dev/github.com/spenserblack/go-defaultmap)\n[![CI](https://github.com/spenserblack/go-defaultmap/actions/workflows/ci.yml/badge.svg)](https://github.com/spenserblack/go-defaultmap/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/spenserblack/go-defaultmap/branch/main/graph/badge.svg?token=WFufDgESL3)](https://codecov.io/gh/spenserblack/go-defaultmap)\n\nA map that supports default values.\n\n## Basic Example\n\n```go\nimport (\n\t\"fmt\"\n\n\t\"github.com/spenserblack/go-defaultmap\"\n)\n\nm := defaultmap.NewMap[string](func() string { return \"I'm the default!\" })\nm.Insert(\"exists\", \"Hello, World!\")\n\nfmt.Println(m.Get(\"exists\")) // Hello, World!\nfmt.Println(m.Get(\"doesn't exist\")) // I'm the default!\nfmt.Println(m.GetOr(\"also doesn't exist\", \"I'm a one-time default!\")) // I'm a one-time default!\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspenserblack%2Fgo-defaultmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspenserblack%2Fgo-defaultmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspenserblack%2Fgo-defaultmap/lists"}