title: How to set timeout for http.Get() requests in Golang?
body: <p>I'm making a URL fetcher in Go and have a list of URLs to fetch. I send <code>http.Get()</code> requests to each URL and obtain their response.</p>
  
  <pre><code>resp,fetch_err := http.Get(url)
  </code></pre>
  
  <p>How can I set a custom timeout for each Get request? (The default time is very long and that makes my fetcher really slow.) I want my fetcher to have a timeout of around 40-45 seconds after which it should return "request timed out" and move on to the next URL.</p>
  
  <p>How can I achieve this?</p>