Which strategy best prevents brittle tests when using interface-based mocks for external API integrations?
In Go, decoupling business logic from external dependencies is typically achieved by defining interfaces and injecting mock implementations during testing. While this allows for integration testing without production credentials, it introduces a risk where tests pass against a mock that no longer reflects the actual API contract. Using net/http/httptest can