Skip to content

Zhwt/yaml-to-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 71.2%
  • CSS 17.7%
  • HTML 11.1%