Golang’s Interfaces Explained with Mocks
Published in
5 min readFeb 16, 2021
--
When I was learning Golang, one of the concepts that took me the most time to grasp was Interfaces. Golang’s Interfaces are a great way to make modular and testable code. But they can also be a bit confusing at first glance.
One of the best ways I’ve found to teach how interfaces work is by creating a mock implementation of an existing Interface.