golang lib to convert yaml into json
go get codeberg.org/6543/go-yaml2json
yaml2json.Convert(data []byte) ([]byte, error)
yaml2json.StreamConvert(r io.Reader, w io.Writer) error
yaml:
- name: Jack
job: Butcher
- name: Jill
job: Cook
obj:
empty: false
data: |
some data 123
with new line
will become json:
[
{
"job": "Butcher",
"name": "Jack"
},
{
"job": "Cook",
"name": "Jill",
"obj": {
"data": "some data 123\nwith new line\n",
"empty": false
}
}
]