Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "encoding/json"
- //"fmt"
- )
- //type nestedMaps map[string]nestedMaps
- func main() {
- byt := []byte(`{
- "node1": {
- "value": "1",
- "node2": {
- "value": "2",
- "node4": {
- "value": "4"
- }
- },
- "node3": {
- "value": "3"
- }
- }
- }`)
- var dat map[string]interface{}
- if err := json.Unmarshal(byt, &dat); err != nil {
- panic(err)
- }
- //fmt.Println(dat["node1"]["node2"]["node4"]["value"]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement