Open kevinmichaelchen opened 5 years ago
even though it would be nice for us - consumers, but it seems it's a popular antipattern in golang.
https://github.com/golang/go/wiki/CodeReviewComments#interfaces
Go interfaces generally belong in the package that uses values of the interface type, not the package that implements those values.
Do not define interfaces on the implementor side of an API "for mocking"; instead, design the API so that it can be tested using the public API of the real implementation.
It'd be nice if there were an interface for the Chargebee client, which provided all the various methods for interacting with the Chargebee SDK.
The Kubernetes Go SDK provides an interface called
kubernetes.Interface
, an actual implementation calledkubernetes.Clientset
, and a implementation for tests calledfake.Clientset
.