Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "encoding/json"
- )
- func main() {
- strJson := `{"key1": "value1", "key2": {"key2.1": "value2.1"}}`
- var jsonified map[string]interface{}
- json.Unmarshal([]byte(strJson), &jsonified)
- fmt.Println("%v", jsonified) // "map[key2:map[key2.1:value2.1] key1:value1]"
- fmt.Println("%v", jsonified["key2"].(map[string]interface{})["key2.1"]) // "value2.1"
- }
Add Comment
Please, Sign In to add comment