3 ms·
How?
by underdeserver 3y ago
How?
- pjmlp 3y ago1 - Interfaces are types on the type system 2 - Interfaces can be combined into type relationships 3 - Due to structural typing, an interface can extend another one by having a common method set, allowing for Liskov substitution, any implementation that takes the base interface, will also take the extended one. What Go cannot guarantee via structural typing is that the subtyping is desired and not a coincidence in method naming.