Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vincentvdk/4c6fd439d6deb757290cb9e0ea31c806 to your computer and use it in GitHub Desktop.
Save vincentvdk/4c6fd439d6deb757290cb9e0ea31c806 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/json"
"fmt"
)
func main() {
b := []byte(`{"key":"value"}`)
var f interface{}
json.Unmarshal(b, &f)
myMap := f.(map[string]interface{})
fmt.Println(myMap["key"])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment