1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package main import ( "fmt" "encoding/json" "io" "os" ) func main() { in, _ := os.Open("example.json") contents, _ := io.ReadAll(in) var m map[string]interface{} json.Unmarshal(contents, &m) fmt.Printf("%v\n", m) }