title: How to mock getClient?
body: <p>I have a function :</p>
  
  <pre><code>func HTTPGet(url string) (*http.Response, error) {
      resp, err := getClient().Get(url)
      return resp, err
  }
  </code></pre>
  
  <p>and getClient function is :</p>
  
  <pre><code>var defaultClient *http.Client
  func getClient() *http.Client {
      if defaultClient == nil {
          defaultClient = &amp;http.Client{
              Timeout:   time.Second * 60,
              Transport: newDefaultTransport(),
          }
      }
      return defaultClient
  }
  </code></pre>
  
  <p>I need to write testcase for HTTPGet for url : "/catalog/v6/providers".</p>
  
  <p>I have written testcase for default URL like :</p>
  
  <pre><code>func Handler(w http.ResponseWriter, r *http.Request) {
       fmt.Fprintf(w, "Hello, Client")
  }
  func TestHTTPGet(t *testing.T) {
      ts := httptest.NewServer(http.HandlerFunc(Handler))
      defer ts.Close()
      mockServerURL := ts.URL
      resp, err := HTTPGet(mockServerURL)
      defer resp.Body.Close()
      body, _ := ioutil.ReadAll(resp.Body)
      assertEquals("Hello, Client", fmt.Sprintf("%s", body), t)
  }
  </code></pre>
  
  <p>But How to write testcase for specific URL.</p>