6 Code: Golang Pros & Cons (Part 2 of 6): Interface Implementation & Public/Private Designations

blog.bluematador.com posted by Philip Volmar 2479 days ago  

Golang Pro: Interface Implementation

Go’s automagic interface implementation is simply amazing. The number one reason we love it is because it saves us from dependency hell.

How Interfaces Work in Golang

Unlike most languages, interfaces in Golang are implemented automatically by structs that match the interface definition. Here’s a simple example. Notice the distinct lack of the implements keyword on the Dog and Cat struct.

Read more

Register to comment or vote on this story