yq/yaml.go

27 lines
299 B
Go
Raw Normal View History

2015-09-26 22:15:49 +00:00
package main
import (
"fmt"
"gopkg.in/yaml.v2"
"log"
)
var data = `
a: Easy!
b:
c: 2
d: [3, 4]
`
func main() {
var m interface{}
err := yaml.Unmarshal([]byte(data), &m)
if err != nil {
log.Fatalf("error: %v", err)
}
fmt.Println("Hello, 世界")
fmt.Println(m)
}