{"id":17120460,"url":"https://github.com/yakuter/optinator","last_synced_at":"2025-04-13T04:52:17.928Z","repository":{"id":43951110,"uuid":"458744305","full_name":"yakuter/optinator","owner":"yakuter","description":"Idiomatic way to fill structs with options logic","archived":false,"fork":false,"pushed_at":"2022-02-13T09:35:23.000Z","size":11,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T04:52:13.943Z","etag":null,"topics":["go","golang","options","struct"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yakuter.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-02-13T07:48:40.000Z","updated_at":"2022-03-15T11:19:36.000Z","dependencies_parsed_at":"2022-09-22T08:51:02.175Z","dependency_job_id":null,"html_url":"https://github.com/yakuter/optinator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yakuter%2Foptinator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yakuter%2Foptinator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yakuter%2Foptinator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yakuter%2Foptinator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yakuter","download_url":"https://codeload.github.com/yakuter/optinator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665767,"owners_count":21142123,"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":["go","golang","options","struct"],"created_at":"2024-10-14T17:59:54.985Z","updated_at":"2025-04-13T04:52:17.903Z","avatar_url":"https://github.com/yakuter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# optinator\nGo packages are generally start with a main struct and the package initiates and fills that struct in the beginning. There are so many ways to fill that struct.  \n\nIn this repo I wanted to show and idiomatic way to fill a struct. This is generally used with \"options\" parameters. So I called it optinator. Hope you find it helpful.\n\nExample usage:\n```go\nfunc main() {\n\treq := NewReq(\n\t\tWithAddress(\"https://yakuter.com\"),\n\t\tWithTimeout(30*time.Second),\n\t\tWithContentType(\"application/json\"),\n\t)\n\n\tfmt.Printf(\"%+v\", req)\n}\n```\n\nSources:  \n- [Different Ways to Initialize Go structs](https://asankov.dev/blog/2022/01/29/different-ways-to-initialize-go-structs/)  \n- [github.com/sethvargo/go-githubactions](https://github.com/sethvargo/go-githubactions/blob/main/options.go)\n- [github.com/binalyze/httpreq](https://github.com/binalyze/httpreq)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakuter%2Foptinator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyakuter%2Foptinator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakuter%2Foptinator/lists"}