title: http Get request in Go (Get a few lines)
body: <p>I need to get only a <strong>first few lines</strong> of a <code>http.Get(&lt;url&gt;</code>) request in go lang.Is there any way to do it.I don't need the entire response. I need to match a pattern which will be there only in the first few lines. Fetching the entire response and getting the regular expression is making it very very slow because the number of characters in the response are very huge.Which is the fastest way to do it.
  Currently i am doing</p>
  
  <pre><code>http.Get(&lt;url&gt;) 
  </code></pre>
  
  <p>// returns a response</p>
  
  <pre><code>ioutil.readAll(response of the above url)
  </code></pre>
  
  <p>// returns a byte array</p>
  
  <pre><code> MyFunction(search for reg exp in the byte array)
  </code></pre>
  
  <p>Is there any method to fetch a few lines or avoid fetching the entire response and match the pattern.</p>