Created
August 8, 2015 14:06
-
-
Save lucacervasio/a3630d8fa573eb62b58c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
b := []byte(`{ | |
"k1" : "v1", | |
"k3" : 10, | |
"result":["v4",12.3,{"k11" : "v11", "k22" : "v22"}] | |
}`) | |
var f interface{} | |
err := json.Unmarshal(b, &f) | |
if err != nil { | |
fmt.Println(err) | |
} | |
m := f.(map[string]interface{}) | |
fmt.Println(m["k1"]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment