title: Converting Structure into byte data and vice versa in golang
body: <p>I am writing a Go program in which I am just geting response from server using -</p>
  
  <pre><code>tr := &amp;http.Transport{
          TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},
      }
  client := &amp;http.Client{Transport: tr}
  link := "address of server"
  resp, err := client.Get(link)
  </code></pre>
  
  <p>Now I need to convert resp into bytes so that I can pass it to some function and other side can decode it into the same structure.
  resp is a structure of http.Response type defined in http package that I can not change.</p>
  
  <p>I want to convert it directly into bytes.</p>
  
  <p>Is there any such function in golang which I can directly use or is there any way exist to do the same.</p>