3 ms·
Most interfaces in Go code have exactly two implementors that will ever be plugged in: the production code and the mock. You want to be able to delve down throu
by closeparen 5y ago
Most interfaces in Go code have exactly two implementors that will ever be plugged in: the production code and the mock. You want to be able to delve down through the layers of production code, e.g. handler to controller to gateway, to trace what's going on in an RPC request.
- grey-area 5y agoIMO those interfaces shouldn't exist, I don't use mocks often. Think about interfaces like io.Reader - why would you want or need to know every implementor of these?