Thanks for the feedback! I love the httptest package, and use it all the time. I have seen some solutions that use this to mock the call, such as this great post by Pieter Claerhout: https://www.yellowduck.be/posts/mocking-a-http-server/

He's doing something similar with a custom HttpClient struct.

IMO either solution works great. I would love to see an example where you think this is done in an even cleaner way. I always love to learn more!

Thanks!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Brandon Atkinson
Brandon Atkinson

Written by Brandon Atkinson

A software engineer who really enjoys learning new tech! Connect with me on LinkedIn: https://tinyurl.com/y5eb48gm or GitHub: https://github.com/atkinsonbg

No responses yet

Write a response