I am trying to use interfaces more in my codebase for a game server I am writing and understand the high level concept and when one should be used (I think). In my case I am using them to decouple my packages from one another amongst other as well as make testing easier.
My question boils down to I have a struct which has ptr receive methods. I am then passing this struct to another function via an interface just like in this playground I am confused as to why a function with a parameter of type interface can accept an address to something that implements that interface. Why is it not func something(f *face)
, what purpose does *interface
serve?