Zhwt / yaml-to-go

Translates YAML into a Go type in your browser instantly.

Home Page:https://zhwt.github.io/yaml-to-go/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Translates YAML into a Go type in your browser instantly.

https://zhwt.github.io/yaml-to-go/

License:MIT License


Languages

Language:JavaScript 71.2%Language:CSS 17.7%Language:HTML 11.1%