{"id":43100750,"url":"https://github.com/go-libfp/try","last_synced_at":"2026-01-31T17:13:17.023Z","repository":{"id":79220496,"uuid":"605320815","full_name":"go-libfp/try","owner":"go-libfp","description":"A  go-friendly error monad. ","archived":false,"fork":false,"pushed_at":"2023-04-17T15:06:29.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-06-20T12:41:23.297Z","etag":null,"topics":["error-handling","functional-programming","go","golang","monad","productivity"],"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/go-libfp.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":"2023-02-22T23:01:29.000Z","updated_at":"2023-04-25T11:53:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"501f39f6-3230-4563-90ed-4292d49e6b37","html_url":"https://github.com/go-libfp/try","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/go-libfp/try","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-libfp%2Ftry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-libfp%2Ftry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-libfp%2Ftry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-libfp%2Ftry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-libfp","download_url":"https://codeload.github.com/go-libfp/try/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-libfp%2Ftry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28948360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["error-handling","functional-programming","go","golang","monad","productivity"],"created_at":"2026-01-31T17:13:16.376Z","updated_at":"2026-01-31T17:13:17.015Z","avatar_url":"https://github.com/go-libfp.png","language":"Go","readme":"[![Docs](https://img.shields.io/badge/godoc-docs-blue.svg?label=\u0026logo=go)](https://pkg.go.dev/github.com/go-libfp/try)\n# try \n\nA lightweight go-friendly error monad. \n\nUse this if you hate rewriting / copy pasting basic error handling patterns. \n\n## Usage \n```go \nimport (\n\t\"github.com/go-libfp/try\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n)\n\n\ntype Foo struct { Bar string}\n\n\nfunc jsonDecode[T any](data []byte) (T, error)  {\n\tvar out T \n\terr := json.Unmarshal(data, \u0026out)\n\treturn out, err \n} \n\n\n\nt := try.WrapErr( json.Marshal(Foo{\"hello\"}) ) \n\t\n\n// bind ET will run a function that returns err tuple  \nt1 := try.BindET(t, jsonDecode[Foo])\n\n\nt2 := try.Map(t1, func(x Foo) string {\n\treturn x.Bar\n}  ) \n\n\nt2.OnSuccess(func(x string) {\n\tfmt.Println(x) \n} ) \n\nt2.OnErr(func(e error) {\n\tlog.Println(e)\n})\n\n_x, _err := t2.Get() \n\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-libfp%2Ftry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-libfp%2Ftry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-libfp%2Ftry/lists"}