Some one asked me the question, how do you decide when to make an interface vs just instantiating a struct?
Honestly, this is not a perfect answer, but here are some simple guidelines that I would follow when creating an interface
or just creating a simple struct
.
Let's start with a simple object Person
. There is nothing astronomical about the object and it contains some simple information. Here there isn't much to create
type Person struct {