|
Michel Casabianca |
at Jan 15, 2015 at 6:30 pm
|
⇧ |
| |
Hi Gustavo,
The article is up to date now. Thanks for your feedback. Please feel free
to send me any thoughs about this parsers overview; any contribution is
welccome!
Best regards
2015-01-15 18:52 GMT+01:00 Gustavo Niemeyer <
gustavo@niemeyer.net>:
Hey Michael,
Would you mind to update the reference to yaml to version v2? (
gopkg.in/yaml.v2)
Thanks!
On Thu Jan 15 2015 at 2:54:12 PM Michel Casabianca <
michel.casabianca@gmail.com> wrote:
Hi Gophers,
I have added this software in my article about GO YAML Parsers:
http://sweetohm.net/html/go-yaml-parsers.en.htmlEnjoy!
2015-01-15 3:03 GMT+01:00 smallfish <
smallfish.xy@gmail.com>:
Hello,
I worte a new package:
https://github.com/smallfish/simpleyaml, similar
as go-simplejson <
https://github.com/bitly/go-simplejson>.
REQUIRED:
gopkg.in/yaml.v2
INSTALL:
go get -u gopkg.in/yaml.v2 # required
go get -u github.com/smallfish/simpleyaml
EXAMPLE:
var data = []byte(`
name: smallfish
age: 99
bool: true
emails:
-
xxx@xx.com-
yyy@yy.combb:
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("bool").Bool()
// y.Get("bb").Get("cc").Get("ee").String()
// y.Get("bb").Get("cc").Get("ee").GetIndex(1).Int()
--
smallfish
http://chenxiaoyu.org--
You received this message because you are subscribed to the Google
Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.--
Michel Casabianca
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.--
Michel Casabianca
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.