title: Go RoundTripper and Transport
body: <p>I am having hard time understanding what we need <code>RoundTripper</code> for in Go.</p>
  
  <p><a href="https://golang.org/pkg/net/http/#RoundTripper" rel="noreferrer">https://golang.org/pkg/net/http/#RoundTripper</a></p>
  
  <p>Explains the default <code>Transport</code> in Go:</p>
  
  <pre><code>var DefaultTransport RoundTripper = &amp;Transport{
         Proxy: ProxyFromEnvironment,
         Dial: (&amp;net.Dialer{
                 Timeout:   30 * time.Second,
                 KeepAlive: 30 * time.Second,
         }).Dial,
         TLSHandshakeTimeout: 10 * time.Second,
  }
  </code></pre>
  
  <p>But what would be the difference between <code>RoundTripper</code> and this:</p>
  
  <pre><code>transport := &amp;http.Transport{
      Proxy:                 http.ProxyFromEnvironment,
      TLSHandshakeTimeout:   timeout,
      Dial:              dialfunc,
      DisableKeepAlives: true,
  }
  </code></pre>
  
  <p>My question: is <code>RoundTripper</code> different than regular <code>Transport</code>?</p>