Skip to content

Instantly share code, notes, and snippets.

@mbeale
Created December 8, 2012 17:47
Show Gist options
  • Save mbeale/4241157 to your computer and use it in GitHub Desktop.
Save mbeale/4241157 to your computer and use it in GitHub Desktop.
Dynamic JSON sample1
var jsondata []interface{}
err := json.Unmarshal(rawData, &jsondata)
if err == nil{
m := v.(map[string]interface{})
//the following prints out the type
fmt.Printf("%s \n",m["type"])
} else {
fmt.Println("error:", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment