Using Go Interfaces for Testable Code

Gabe Szczepanek
Aug 22, 2019 · 4 min read
Photo by Mirza Babic on Unsplash

Interfaces are abstractions that define the behavior of a particular type but do not specify the details of how that behavior is implemented. If you think of a bank teller, you understand that you can request and receive money from them (provided you have the money in your bank account of course). Whether the teller is an employee at a bank branch or the ATM at your local deli the outcome defined by the “teller” interface…