title: Pretty JSON retrieved from response in GoLang
body: <p>I retrieve JSON as GET response from and endpoint</p>
  
  <pre><code>response, _ := http.Get("https://website-returning-json-value.com")
  data, _ := ioutil.ReadAll(response.Body)
  w.Write(data)
  </code></pre>
  
  <p>It returns me a JSON value, which is OK, but it is very ugly (no indents etc.). I would like to make it pretty. I've read that there is util function like MarshalIndent which does the job, but this works for JSON object (?) and ReadAll function returns []byte, so it does not work. I read the documentation regarding encoding/json package but there's a lot of information and I got a little bit stuck/confused.</p>
  
  <p>As far as I understand it should be done, I should get []byte via ReadAll function -> convert it to the JSON -> prettify it -> turn to []byte again.</p>