This is a creation in
Article, where the information may have evolved or changed.
39. Toad Notes Go language--interface
In go, the reserved word interface is given a number of different meanings. Each type has an interface, which means that a collection of methods is defined for that type.
An interface is defined as a collection of methods. Method contains the actual code. In other words, an interface is defined, and the method is implemented. Therefore, the receiver cannot be defined as an interface type, and doing so will cause invalid receiver type ... Compiler error.
According to the rules, the single-method interface is named method name plus-er suffix: reader,writer,formatter, etc.
There are a bunch of such names that efficiently reflect their responsibilities and the names of the functions they contain. Read,write,close,flush,string and so on have a normative statement and meaning. To avoid confusion, do not let the same name be used unless there is a similar declaration and meaning. Conversely, if a type implements the same method as a well-known type, the same name and declaration are used, and the string conversion method is named string instead of ToString.