Interfaces might seem like a strange concept to newcomers in programming, and to programmers who have not used interfaces because they were either never too confident about them, or maybe because the tools they have used so far did not rely on using interfaces much.

Well, interfaces should be making your life easier instead of making you stress out! And I am writing this blog to show you exactly why.

We will understand the concept of interfaces, using one of my favourite games: Witcher 3, as the base.

In the game, consider the following two types of characters who often run into each other and end up fighting:



Both of these types of characters share some common traits:




Vitality (or health)

However, they also have unique characteristics of their own. For example, a witcher may belong to a certain school and a monster will belong to a certain class of monsters.

#golang #go #web-development #programming #developer

Understanding Interfaces in Go
2.10 GEEK