Skip to content

chanced/transcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transcode is markup language conversion library

Go Reference

transcode is a go library that will convert markup languages (currently JSON and YAML) from one form to another.

Motivation

While it is possible to decode JSON as YAML, doing so comes with caveats. YAML is a superset of JSON and so unmarshaling a YAML object into interface{} will result in map[interface{}]interface{}. When you need to work with the raw data or would like to work with JSON Schema, this can be problematic.

Encoding JSON as YAML is easily accomplishable with standard tooling. However, this library will be faster than unmarshaling JSON as interface{}, and then remarshaling as YAML. It also provides some very minimal formatting.

There are some drawbacks to using transcode though:

  • YAML aliases are not supported
  • All keys remain strings when transcoding into YAML
  • YAML comments are obviously lost

License

MIT

About

a markup language conversion library for go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages