Interfaces 101 : Interface Design Considerations Ep. 7

1 · · March 13, 2023, 9:45 p.m.
Introduction In episode 6, Miki built a logger package with the aim of making it as versatile as possible. To achieve this, he constructed his logger object with a function that would: accept the io.Writer interface as a parameter and perform type assertions to retrieve other interface types as needed. By building this, Miki demonstrated how polymorphism is achieved with Go by changing the type of a variable with type assertions....