i use this and work fine url :="http://192.168.0.28:8000/api/filter/192.168.0.31/" resp, err := http.Get(url) defer resp.Body.Close() if err != nil { panic(err) } jsonDataFromHttp, err := ioutil.ReadAll(resp.Body) if err != nil { panic(err) } var jsonData []RetourAPI err = json.Unmarshal([]byte(jsonDataFromHttp), &jsonData) if err != nil { panic(err) } fmt.Println(jsonData[0].IP)
now, I will try to make it a function -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.