{"id":13412969,"url":"https://github.com/jmattheis/goverter","last_synced_at":"2026-01-06T12:13:38.226Z","repository":{"id":37624772,"uuid":"346138158","full_name":"jmattheis/goverter","owner":"jmattheis","description":"Generate type-safe Go converters by simply defining an interface","archived":false,"fork":false,"pushed_at":"2024-04-10T17:30:05.000Z","size":704,"stargazers_count":442,"open_issues_count":9,"forks_count":40,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-02T02:34:14.576Z","etag":null,"topics":["code-generation","converter","copy","generator","go","golang","struct"],"latest_commit_sha":null,"homepage":"https://goverter.jmattheis.de/","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/jmattheis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"jmattheis","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://jmattheis.de/donate"}},"created_at":"2021-03-09T20:39:27.000Z","updated_at":"2024-05-29T22:41:24.658Z","dependencies_parsed_at":"2023-12-21T20:31:57.577Z","dependency_job_id":"d070a0aa-186e-42bc-8bd5-c909583cb89f","html_url":"https://github.com/jmattheis/goverter","commit_stats":{"total_commits":170,"total_committers":11,"mean_commits":"15.454545454545455","dds":"0.11176470588235299","last_synced_commit":"d7f3125a2a674b9ace973f51817adb96d5e0be1c"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmattheis%2Fgoverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmattheis%2Fgoverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmattheis%2Fgoverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmattheis%2Fgoverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmattheis","download_url":"https://codeload.github.com/jmattheis/goverter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247137642,"owners_count":20889906,"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":["code-generation","converter","copy","generator","go","golang","struct"],"created_at":"2024-07-30T20:01:31.733Z","updated_at":"2026-01-06T12:13:38.182Z","avatar_url":"https://github.com/jmattheis.png","language":"Go","funding_links":["https://github.com/sponsors/jmattheis","https://jmattheis.de/donate"],"categories":["Go","Relational Databases","发电机","Generators","Generation and Generics"],"sub_categories":["检索及分析资料库","Search and Analytic Databases","Advanced Console UIs","Utility/Miscellaneous"],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg width=\"300\" src=\".github/logo.svg\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003egoverter\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003ci\u003ea \"type-safe Go converter\" generator\u003c/i\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/jmattheis/goverter/actions/workflows/build.yml\"\u003e\n        \u003cimg alt=\"Build Status\" src=\"https://github.com/jmattheis/goverter/actions/workflows/build.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n     \u003ca href=\"https://codecov.io/gh/jmattheis/goverter\"\u003e\n        \u003cimg alt=\"codecov\" src=\"https://codecov.io/gh/jmattheis/goverter/branch/main/graph/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/jmattheis/goverter\"\u003e\n        \u003cimg alt=\"Go Report Card\" src=\"https://goreportcard.com/badge/github.com/jmattheis/goverter\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/jmattheis/goverter\"\u003e\n        \u003cimg alt=\"Go Reference\" src=\"https://pkg.go.dev/badge/github.com/jmattheis/goverter.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/jmattheis/goverter/releases/latest\"\u003e\n        \u003cimg alt=\"latest release\" src=\"https://img.shields.io/github/release/jmattheis/goverter.svg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\ngoverter is a tool for creating type-safe converters. All you have to\ndo is create an interface and execute goverter. The project is meant as\nalternative to [jinzhu/copier](https://github.com/jinzhu/copier) that doesn't\nuse reflection.\n\n[Getting Started](https://goverter.jmattheis.de/guide/getting-started) ᛫\n[Installation](https://goverter.jmattheis.de/guide/install) ᛫\n[CLI](https://goverter.jmattheis.de/reference/cli) ᛫\n[Config](https://goverter.jmattheis.de/reference/settings)\n\n## Features\n\n- **Fast execution**: No reflection is used at runtime\n- Automatically converts builtin types: slices, maps, named types, primitive\n  types, pointers, structs with same fields\n- [Enum support](https://goverter.jmattheis.de/guide/enum)\n- [Deep copies](https://en.wikipedia.org/wiki/Object_copying#Deep_copy) per\n  default and supports [shallow\n  copying](https://en.wikipedia.org/wiki/Object_copying#Shallow_copy)\n- **Customizable**: [You can implement custom converter methods](https://goverter.jmattheis.de/reference/extend)\n- [Clear errors when generating the conversion methods](https://goverter.jmattheis.de/guide/error-early) if\n  - the target struct has unmapped fields\n  - types cannot be converted without losing information\n- Detailed [documentation](https://goverter.jmattheis.de/) with a lot examples\n- Thoroughly tested, see [our test scenarios](./scenario)\n\n## Example\n\nGiven this converter:\n\n```go\npackage example\n\n// goverter:converter\ntype Converter interface {\n    ConvertItems(source []Input) []Output\n\n    // goverter:ignore Irrelevant\n    // goverter:map Nested.AgeInYears Age\n    Convert(source Input) Output\n}\n\ntype Input struct {\n    Name string\n    Nested InputNested\n}\ntype InputNested struct {\n    AgeInYears int\n}\ntype Output struct {\n    Name string\n    Age int\n    Irrelevant bool\n}\n```\n\nGoverter will generated these conversion methods:\n\n```go\npackage generated\n\nimport example \"goverter/example\"\n\ntype ConverterImpl struct{}\n\nfunc (c *ConverterImpl) Convert(source example.Input) example.Output {\n    var exampleOutput example.Output\n    exampleOutput.Name = source.Name\n    exampleOutput.Age = source.Nested.AgeInYears\n    return exampleOutput\n}\nfunc (c *ConverterImpl) ConvertItems(source []example.Input) []example.Output {\n    var exampleOutputList []example.Output\n    if source != nil {\n        exampleOutputList = make([]example.Output, len(source))\n        for i := 0; i \u003c len(source); i++ {\n            exampleOutputList[i] = c.Convert(source[i])\n        }\n    }\n    return exampleOutputList\n}\n```\n\nSee [Getting Started](https://goverter.jmattheis.de/guide/getting-started).\n\n## Versioning\n\ngoverter uses [SemVer](http://semver.org/) for versioning the cli.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE)\nfile for details\n\n_Logo by [MariaLetta](https://github.com/MariaLetta)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmattheis%2Fgoverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmattheis%2Fgoverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmattheis%2Fgoverter/lists"}