您能解释一下Go接口吗?

I dont get the whole types + Interfaces model(that replaces classes in other languages). If theres a simple way you could explain what they are about, it will be really appreciated.

Go interfaces are statically checked duck typing.

The difference between pure virtual classes in C++ or interfaces in java is that you don't declare the interface on the class that implements the interface, but on the method that receives the interface.

For example, I can create an interface with a Read and a Write method and call it ThingsDustinReadsAndWrites and have a function called doReadsAndWrites(rr ThingsDustinReadsAndWrites. That can, in turn, receive a built-in http.ClientConn which has never heard of my interface, but implements it because it happens to have those methods.