This commit is contained in:
Mike Farah 2015-09-27 08:15:49 +10:00
parent 66e832a1fc
commit c00f686a74

26
yaml.go Normal file
View File

@ -0,0 +1,26 @@
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)
}