{"id":21288149,"url":"https://github.com/karitham/go-genial","last_synced_at":"2025-10-21T07:32:18.276Z","repository":{"id":50340067,"uuid":"424007028","full_name":"karitham/go-genial","owner":"karitham","description":"A golang code-generator helper.","archived":false,"fork":false,"pushed_at":"2022-01-28T14:51:53.000Z","size":25,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-11T14:27:35.108Z","etag":null,"topics":["codegen","golang"],"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/karitham.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":"2021-11-02T21:40:14.000Z","updated_at":"2022-07-28T11:55:40.000Z","dependencies_parsed_at":"2022-09-05T13:11:24.865Z","dependency_job_id":null,"html_url":"https://github.com/karitham/go-genial","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/karitham/go-genial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karitham%2Fgo-genial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karitham%2Fgo-genial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karitham%2Fgo-genial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karitham%2Fgo-genial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karitham","download_url":"https://codeload.github.com/karitham/go-genial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karitham%2Fgo-genial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274051240,"owners_count":25214024,"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-07T02:00:09.463Z","response_time":67,"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":["codegen","golang"],"created_at":"2024-11-21T12:18:59.151Z","updated_at":"2025-10-21T07:32:18.204Z","avatar_url":"https://github.com/karitham.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-genial\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/Karitham/go-genial.svg)](https://pkg.go.dev/github.com/Karitham/go-genial)\n\nA golang code-generation library\n\n## Install\n\n`go get github.com/karitham/go-genial`\n\n## Example\n\n```go\n\tp := \u0026genial.PackageB{}\n\tp.Comment(\"example is an example package\").\n\t\tName(\"example\").\n\t\tImports(\"encoding/json\")\n\n\tt := \u0026genial.StructB{}\n\tt.Comment(\"Baz is a implementation of Iface\").\n\t\tName(\"Baz\").\n\t\tField(\"Foo\", \"*string\", genial.StructTag{Type: \"json\", Value: \"foo,omitempty\"}).\n\t\tField(\"rest\", \"json.Raw\")\n\n\tf := \u0026genial.FuncB{}\n\tf.Comment(\"FooBar is a new example function\").\n\t\tName(\"FooBar\").\n\t\tReceiver(\"b\", \"*Baz\").\n\t\tParameter(\"foo\", \"int\").\n\t\tParameter(\"bar\", \"string\").\n\t\tReturnTypes(\"int\", \"error\").\n\t\tWriteString(`panic(\"not implemented\")`)\n\n\ti := \u0026genial.InterfaceB{}\n\ti.Comment(\"Iface is an example interface\").\n\t\tMembers(f).\n\t\tName(\"Iface\")\n\n\tp.Declarations(t, i, f).WriteTo(os.Stdout)\n```\n\ngenerates\n\n```go\n// example is an example package\npackage example\n\nimport \"encoding/json\"\n\n// Baz is a implementation of Iface\ntype Baz struct {\n\tFoo  *string `json:\"foo,omitempty\"`\n\trest json.Raw\n}\n\n// Iface is an example interface\ntype Iface interface {\n\t// FooBar is a new example function\n\tFooBar(foo int, bar string) (int, error)\n}\n\n// FooBar is a new example function\nfunc (b *Baz) FooBar(foo int, bar string) (int, error) {\n\tpanic(\"not implemented\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaritham%2Fgo-genial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaritham%2Fgo-genial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaritham%2Fgo-genial/lists"}