Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/birchb1024/yamlspew
- Owner: birchb1024
- License: gpl-3.0
- Created: 2019-06-06T02:58:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-06T03:03:39.000Z (over 5 years ago)
- Last Synced: 2023-03-22T18:52:44.905Z (almost 2 years ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"