A VSCode extension for converting Go structs to TypeScript interfaces and vice versa.
Helpful for simple JSON API design.
Also check go4lage.com.
Features
- Adds JSON tags if missing in Go structs.
- Convert Go structs to TypeScript interfaces.
- Convert TypeScript interfaces to Go structs.
- Context menu integration for quick access
- Configurable context menu visibility
- Handles basic Go types and common struct tags
- Supports optional fields (
omitempty)
Demo

GO <-> TS

Installation
- Install the extension from the VSCode Marketplace (available soon)
- Reload VSCode
Or Download here.
(https://workupload.com/file/J2m4DwcNGeB)[https://workupload.com/file/J2m4DwcNGeB]
Usage
- Select a Go struct or TypeScript interface in your editor
- Right-click and choose "Convert Struct ↔ Interface (Go ↔ TS)" from the context menu
- The converted code will replace the selected text
Commands
go4lagetool.convert: Convert Go struct ↔ TypeScript interface
Configuration
go4lagetool.showContextMenu: Show/hide the convert option in the editor context menu (default: true)
Supported Types
Go to TypeScript
| Go Type |
TypeScript Type |
string |
string |
int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64 |
number |
bool |
boolean |
time.Time |
string |
[]T |
T[] |
*T |
T |
TypeScript to Go
| TypeScript Type |
Go Type |
string |
string |
number |
int |
boolean |
bool |
T[] |
[]T |
License
MIT License - see the LICENSE file for details.
| |