Golang пример unmarshal json в map
req, _ := http.NewRequest(http.MethodGet, «https://api.example.com/messages», nil) resp,_ := httpClient.Do(req) bodyBytes, err := ioutil.ReadAll(resp.Body) var data map[string]interface{} err = json.Unmarshal(bodyBytes, &data) if err != nil { log.Fatal(err) } logs := data[«messages»] for _, log := range logs.([]interface{}) { log = log.(map[string]interface{})[«message»]…
Read more