Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/birchb1024/yamlspew

Simple program to parse YAML with Golang and output the parsed tree with 'spew', a deep pretty printer for Go data structures.
https://github.com/birchb1024/yamlspew

Last synced: about 2 months ago
JSON representation

Simple program to parse YAML with Golang and output the parsed tree with 'spew', a deep pretty printer for Go data structures.

Awesome Lists containing this project

README

        

# yamlspew

Simple program to parse YAML with Golang and output the parsed tree with 'spew':[https://godoc.org/github.com/davecgh/go-spew/spew], a deep pretty printer for Go data structures.

yamlspew reads from standard input and outputs every document as 'spew' rendition of the parse objects. Documents are seperated by a // comment line.

Example usage:

```
$ echo '{ int: 2, float: 3.4e5, bool: true, nothing: ~ , sequence: [1,2], base64: !!binary WUVT } ' | ./yamlspew
(map[interface {}]interface {}) (len=6) {
(string) (len=8) "sequence": ([]interface {}) (len=2 cap=2) {
(int) 1,
(int) 2
},
(string) (len=6) "base64": (string) (len=3) "YES",
(string) (len=3) "int": (int) 2,
(string) (len=5) "float": (float64) 340000,
(string) (len=4) "bool": (bool) true,
(string) (len=7) "nothing": (interface {})
}

```

yamlok uses the Go language YAML parser "gopkg.in/yaml.v3"