setting up unit testing, I'm realizing that there are a number of places
where I'm making external API requests that don't necessarily need to be
tested. Is there a way to overwrite my client in testing with a custom
transport or roundtripper that restricts the fetches to only specific
allowed urls? I only want to allow localhost + connections to httptest
servers that I spin up for mocks.
To be clear, I know how to set up my tests so I can overwrite the
destination url or pass in interfaces. This is more of a failsafe for
mistakes or jr devs, to keep from accidentally creating thousands of
unnecessary clients and campaigns if someone forgets to set things up
properly. :)
Thanks,
Derek
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.