Skip to content

Instantly share code, notes, and snippets.

@nevzatalkan
Last active May 15, 2024 08:57
Show Gist options
  • Save nevzatalkan/f5c5ef66e88dd446976401967b6731e8 to your computer and use it in GitHub Desktop.
Save nevzatalkan/f5c5ef66e88dd446976401967b6731e8 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"])
}
@goelshubham
Copy link

Thanks mate!! u bro!!

@Polo4444
Copy link

How to do it for net maps, per example:
map[string]map[string]interface{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment