mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
init
This commit is contained in:
parent
66e832a1fc
commit
c00f686a74
26
yaml.go
Normal file
26
yaml.go
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user