Grokking Advanced Go
0% completed
Designing Interfaces for Consumers
An interface belongs to the code that uses it when that code declares the interface itself and lists only the methods that it calls. The code that uses an interface is its consumer, and the code that provides the methods is its implementer. In languages such as Java, a class must name the interface it implements, so the interface is usually declared with the implementation. Go has no such requirement, so the consumer can write the declaration.
The rule follows from this
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%