2018-01-05から1日間の記事一覧
httpレスポンスを構造体にmappingする際に以下のようなコードを書くケースは多々あると思います。 ※ error handlingは割愛 // responseの取得 resp, _ := http.Get(url) body := resp.Body defer body.Close() // []byteへの変換 b, _ := ioutil.ReadAll(bod…
httpレスポンスを構造体にmappingする際に以下のようなコードを書くケースは多々あると思います。 ※ error handlingは割愛 // responseの取得 resp, _ := http.Get(url) body := resp.Body defer body.Close() // []byteへの変換 b, _ := ioutil.ReadAll(bod…