/
View dependency graph
Depends on
- dh-golang (dh-golang)
- golang-defaults (golang-any)
- golang-testify (golang-github-stretchr-testify-dev)
- golang-yaml.v2 (golang-yaml.v2-dev)
- debhelper-compat
README (full)
simpleyaml
a Go package to interact with arbitrary YAML, similar as go-simplejson.
INSTALL
$ go get -u -v github.com/smallfish/simpleyaml
EXAMPLE
var data = []byte(`
name: smallfish
age: 99
float: 3.14159
bool: true
emails:
- [email protected]
- [email protected]
bb:
cc:
dd:
- 111
- 222
- 333
ee: aaa
`)
y, err := NewYaml(data)
if err != nil {
// ERROR
}
name, err := y.Get("name").String()
if err != nil {
// ERROR
}
fmt.Println("name:", name)
// y.Get("age").Int()
// y.Get("float").Float()
// y.Get("bool").Bool()
// y.Get("bb").Get("cc").Get("ee").String()
// y.Get("bb").Get("cc").Get("ee").GetIndex(1).Int()
// y.GetPath("bb", "cc", "ee").String()
END
| dir | debian/ |
| dir | helper/ |
| file | .gitignore |
| file | LICENSE |
| file | README.md |
| file | go.mod |
| file | go.sum |
| file | simpleyaml.go |
| file | simpleyaml_test.go |
