title: How to point stripe-go to stripe-mock local server?
body: <p>I am using <a href="https://github.com/stripe/stripe-go#without-a-client" rel="nofollow noreferrer">stripe-go</a> to perform Stripe actions such as create a new customer, add a credit card, create a subscription and so on. I want to perform end-to-end testing. There is <a href="https://github.com/stripe/stripe-mock" rel="nofollow noreferrer">stripe-mock</a> which is a mock HTTP server that responds like the real Stripe API. I have that running locally in a terminal. How do I point my stripe-go which I am using in my Go application to make calls to this mock HTTP server instead of the real Stripe API.</p>
  
  <p>In the stripe-go documentation there is this </p>
  
  <pre><code>// Setup
  stripe.Key = "sk_key"
  
  stripe.SetBackend("api", backend) // optional, useful for mocking
  </code></pre>
  
  <p>Am I supposed to pass something special as <code>backend</code> so that stripe-go knows to then make calls to <a href="http://localhost:12111" rel="nofollow noreferrer">http://localhost:12111</a> which is the address of stripe-mock?</p>
  
  <p>This is <code>stripe.SetBackend</code></p>
  
  <pre><code>// SetBackend sets the backend used in the binding.
  func SetBackend(backend SupportedBackend, b Backend) {
      switch backend {
      case APIBackend:
          backends.API = b
      case UploadsBackend:
          backends.Uploads = b
      }
  }
  </code></pre>
  
  <p>This is <code>Backend</code></p>
  
  <pre><code>// Backend is an interface for making calls against a Stripe service.
  // This interface exists to enable mocking for during testing if needed.
  type Backend interface {
      Call(method, path, key string, body *RequestValues, params *Params, v interface{}) error
      CallMultipart(method, path, key, boundary string, body io.Reader, params *Params, v interface{}) error
  }
  </code></pre>