https://github.com/fabien0102/go2dts
A simple cli-tools to transform golang `struct` and `const` to typescript `interface` and `type`
https://github.com/fabien0102/go2dts
codegen go typescript
Last synced: 5 months ago
JSON representation
A simple cli-tools to transform golang `struct` and `const` to typescript `interface` and `type`
- Host: GitHub
- URL: https://github.com/fabien0102/go2dts
- Owner: fabien0102
- Created: 2018-07-25T11:47:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T08:28:09.000Z (almost 3 years ago)
- Last Synced: 2025-02-25T08:01:38.517Z (7 months ago)
- Topics: codegen, go, typescript
- Language: Go
- Size: 829 KB
- Stars: 44
- Watchers: 4
- Forks: 5
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go2dts

A simple cli-tools to transform golang `struct` and `const` to typescript `interface` and `type`
### Installation
```bash
npm i -g go2dts
```### Usage
```bash
go2dts
```### Testing and developing
Just put your golang file into `__tests__/inputs` and it will be parse each time you execute `npm test` or `npm start`.
`npm start` is more quick, so perfect to add some console.log and improve the parsing.
`npm test --watch` generate a snapshot, so you can just update this one to the expecting state and start coding to have everything green #TDDStyle
### Know issues
- The type mapping is incomplete (I'm not a golang developper, so I add types when I discover them)
- This library will not follow the `import` dependencies, so the output types can be broken