title: cannot use baseURL (type *url.URL) as type string in argument to http.Get
body: <p>I wrote a simple web server that appends some relative path to the base URL using url.ResolveReference. And then I want to get the content of resultant URL using http.Get() but the problem is that http.get() take string as the argument and I have an object of type *url.URL.How can I resolve this problem?</p>
  
  <p>My code is given bellow:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "io/ioutil"
      "log"
      "net/http"
      "net/url"
  )
  
  func factHandler(w http.ResponseWriter, r *http.Request) {
      str1 := "http://www.meaningfultype.com/"
      u1, _ := url.Parse(str1)
      str2 := "/clarendon.html"
      u2, _ := url.Parse(str2)
      u3 := u1.ResolveReference(u2)
      fmt.Println("url:", u3)
      res, err := http.Get(u3)
      if err != nil {
          log.Fatal(err)
      }
      robots, err := ioutil.ReadAll(res.Body)
  
      res.Body.Close()
      if err != nil {
          log.Fatal(err)
      }
      contentType := res.Header.Get("Content-Type")
      w.Header().Set("Content-Type", contentType)
      w.Write(robots)
  }
  </code></pre>