{"id":17004806,"url":"https://github.com/gtramontina/go-extlib","last_synced_at":"2025-10-07T01:11:04.541Z","repository":{"id":40001495,"uuid":"415216301","full_name":"gtramontina/go-extlib","owner":"gtramontina","description":"Go Extended Lib","archived":false,"fork":false,"pushed_at":"2023-03-05T10:52:30.000Z","size":295,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-01T12:43:25.426Z","etag":null,"topics":["extended","generic-types","go","golang","stdlib","stdlib-extras"],"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/gtramontina.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":"2021-10-09T05:54:35.000Z","updated_at":"2024-10-10T16:00:56.000Z","dependencies_parsed_at":"2024-06-20T06:26:42.252Z","dependency_job_id":"f4cfdcaa-499a-4c32-ada6-163c100d2cf0","html_url":"https://github.com/gtramontina/go-extlib","commit_stats":null,"previous_names":["gtramontina/go-collections"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gtramontina/go-extlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtramontina%2Fgo-extlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtramontina%2Fgo-extlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtramontina%2Fgo-extlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtramontina%2Fgo-extlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gtramontina","download_url":"https://codeload.github.com/gtramontina/go-extlib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtramontina%2Fgo-extlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278704518,"owners_count":26031381,"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-10-06T02:00:05.630Z","response_time":65,"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":["extended","generic-types","go","golang","stdlib","stdlib-extras"],"created_at":"2024-10-14T04:44:30.667Z","updated_at":"2025-10-07T01:11:04.525Z","avatar_url":"https://github.com/gtramontina.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n  \u003cimg alt=\"ExtLib Logo\" height=\"48\" src=\"https://gist.githubusercontent.com/gtramontina/f3a29963a7aa558d72098f149ebe0e09/raw/f85c9e12ebb741188d1de0d1ab1b16da0330df17/go-extlib.svg\"\u003e\n  \u003cimg alt=\"ExtLib Gopher Mascot\" height=\"48\" src=\"https://storage.googleapis.com/gopherizeme.appspot.com/gophers/9edef573bbbfd880698627fea674fad14bbce477.png\" align=\"right\"\u003e\n\u003c/h1\u003e\n\n\u003csup\u003e\u003cb\u003e⚠️ Note:\u003c/b\u003e This is still an \u003cem\u003eexperiment\u003c/em\u003e.\u003c/sup\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/gtramontina/go-extlib\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/github.com/gtramontina/go-extlib.svg\" alt=\"Go Reference\" align=\"right\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/gtramontina/go-extlib/actions/workflows/ci.yml\"\u003e\u003cimg alt=\"Build Badge\" src=\"https://github.com/gtramontina/go-collections/actions/workflows/ci.yml/badge.svg\" align=\"right\"\u003e\u003c/a\u003e\n\n## Motivation\n\nMy main motivation was to try out generics in Go. I jumped straight into the usual suspects: [`Filter`](https://github.com/gtramontina/go-extlib/blob/main/collections/filter.go) and [`Map`](https://github.com/gtramontina/go-extlib/blob/main/collections/map.go). When testing these, I saw the need for assertion functions: another opportunity to exercise some more generics! It is now part of this ext-lib under lives as an [testing/assert](https://github.com/gtramontina/go-extlib/blob/main/testing/assert).\n\nLater I thought it would be nice to implement [`Set`](https://github.com/gtramontina/go-extlib/tree/main/set), and then [`HashMap`](https://github.com/gtramontina/go-extlib/tree/main/hashmap), with which I got carried away and ended up implementing a somewhat naïve [hasher](https://github.com/gtramontina/go-extlib/blob/main/internal/hash/hash.go) (you can read more on the rationale on [this commit](https://github.com/gtramontina/go-extlib/commit/808ac8236c433587c4dc2f85479c1189a5df6010)).\n\nWhen I realized, I was already having fun with [`Maybe`](https://github.com/gtramontina/go-extlib/tree/main/maybe), [`Either`](https://github.com/gtramontina/go-extlib/tree/main/either) and [`Result`](https://github.com/gtramontina/go-extlib/tree/main/result). Here is where I stumbled upon some limitations of Go generics. Right when I was experimenting with it, I came across a blog post by [@hypirion](https://github.com/hypirion) titled \"[Type-Safe HTTP Servers in Go via Generics](https://hypirion.com/musings/type-safe-http-servers-in-go-via-generics)\" where the author bumps into these same limitations.\n\nWhen writing software in Go, I've always wanted slightly higher level constructs, especially to represent business domain concepts. Some may say I haven't fully embraced Go. Perhaps I haven't 🤷. But I sure know people who'd also like to go up in abstraction a tad bit.\n\nHope this is enough motivation… 😅\n\n⚠️ As the note above says, this is an experiment and no attention was paid to performance or allocations.\n\n##  The ExtLib\n\n\u003csup\u003e🚧 This section is a work in progress.\u003c/sup\u003e\n\n---\n\n\u003cp align=\"right\"\u003e\n  \u003csub\u003e\u003csup\u003e\u003ci\u003eGopher: \u003c/i\u003e\u003ca href=\"https://gopherize.me/gopher/9edef573bbbfd880698627fea674fad14bbce477\"\u003egopherize.me\u003c/a\u003e\u003c/sup\u003e\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtramontina%2Fgo-extlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgtramontina%2Fgo-extlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtramontina%2Fgo-extlib/lists"}