Skip to content
This repository has been archived by the owner on Mar 22, 2020. It is now read-only.
/ yaml-to-go Public archive

Generate go package from yaml! Don't use this.

License

Notifications You must be signed in to change notification settings

prysmaticlabs/yaml-to-go

Repository files navigation

Yaml to Go

Create a go package from a given yaml file.

Caveats specifically for processing Ethereum 2.0 yaml spec tests:

  • Hex strings are treated as bytes. You must handle hex encoded strings as binary data when serializing the yaml data.
  • If a hex encoded byte string is 32, 48, or 96 bytes, then ssz tag is added to the struct. Example: ssz:"size=32"
  • All number values are treated as unsigned 64 bit integers, unless it is a decimal number then it would be float64.
  • This library actually adds json tags to the structs because that seems to be the only way it works with github.com/ghodss/yaml

Note: This project is not unit tested or held to any high code standards. It exists purely due to the nuances in eth2 spec tests where existing code generation and yaml processing would not work. In other words, it's bad!

Credits

Much of the original code was written in mholt/json-to-go (MIT).

About

Generate go package from yaml! Don't use this.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published