Go interfaces have a statically verified duck print.
The difference between pure C ++ virtual classes or interfaces in java is that you do not declare an interface in a class that implements the interface, but in a method that receives the interface.
For example, I can create an interface using the Read and Write method and call it ThingsDustinReadsAndWrites and have a function called doReadsAndWrites(rr ThingsDustinReadsAndWrites . This can, in turn, get a built-in http.ClientConn that never heard of my interface, but implements it because he has these methods.
Dustin
source share