DevilKing's blog

冷灯看剑,剑上几分功名?炉香无需计苍生,纵一穿烟逝,万丈云埋,孤阳还照古陵

0%

Golang Interface

在面向对象的编程中,a protocal or interface is a common means for unrelated objects to communicate with each other

why do we use interfaces?

  • writing generic algorithms
  • hiding implementation details
  • providing interception points

interface need runtime checks

The bigger the interface, the weaker the abstraction

abstract data type