Best practices around mocking interfaces from external packages

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/golang

Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
  • GitHub repo httpmock

    HTTP mocking for Golang

    Alternatively, you could use an http mock library like https://github.com/jarcoal/httpmock, and override the urls the RealClient calls with a mock response in your tests.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts