GoDMT, the one and only Go Data Model Translator. The goal of this project is to provide a tool that can parse Go files that include
type into an abstract syntax tree, aka AST.
That AST will then be transformed into data models for several programming languages. Currently GoDMT can perform translations to:
- Swift (using Decodable structs)
Some small adjustments may need to be made to integrate the output into a project, but this should already save you a lot of time and hassle, and will help you stay in sync with the Go version of your data models, in other languages. Comments will be carried over
Currently, the tested operating systems are:
- Linux (amd64)
- FreeBSD (amd64)
- macOS (amd64)
- Windows (amd64)
Feel free to expand this list if you have successfully used the tool in other environments. You will find pre-compiled binaries of the tool in the releases page.
Talk is cheap, show code
Feel free to browse some examples that I am happy to provide here:
See the CLI Usage wiki page for more details on using the tool.
See the Tags and Name Conversion section to understand more about how entities get parsed and converted to other languages.
To build this application as a binary simply navigate to
cmd/godmt and run