Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 1.22 KB

README.md

File metadata and controls

24 lines (14 loc) · 1.22 KB

YAML to Go

YAML-to-Go converts YAML to a Go struct

Parse and translates YAML into a Go struct definition. Check it out!

This project is aimed to provide an online service. In case you need the js library only, click here to download.

In fact, there is already a yaml-to-go tool by mengzhuo, however that project seems abandoned and no longer maintained, so I started my own version.

Things to note:

  • The yaml is parsed by js-yaml.
  • The script sometimes has to make some assumptions, so give the output a once-over.
  • In an array of objects, the generated object will share all properties among them.
  • The output is indented, but not formatted. Use go fmt!

Contributions are welcome!

Credits

The original JSON-to-Go tool is written by Matt Holt.

The Go Gopher is originally by Renee French. This artwork is an adaptation.