title: how to make an absolute path http redirect in golang
body: <p>I was reading the source code <a href="https://github.com/nf/goto" rel="noreferrer">goto</a>, and I found the code below in <a href="https://github.com/nf/goto/blob/master/talk/code/0/main.go" rel="noreferrer">goto/talk/0/main.go</a>:</p>
  
  <pre><code>http.Redirect(w, r, url, http.StatusFound)
  </code></pre>
  
  <p>According to the context, <code>url</code> was an absolute path, and an absolute path redirect was expected. But as the <a href="http://golang.org/pkg/net/http/#Redirect" rel="noreferrer">golang/http/redirect</a> mentioned:</p>
  
  <blockquote>
    <p><code>Redirect</code> replies to the request with a redirect to url, which may be a path relative to the request path.</p>
  </blockquote>
  
  <p>It results as a relative path redirect. I don't know if <code>http.Redirect</code> did an absolute path redirect before, but it doesn't nowadays.</p>
  
  <p>So how can I make an absolute path redirect in golang?
  I searched the Internet, but found nothing,can anyone help me?
  Thanks in advance.</p>