interface

interface 定义

特点:

  1. 函数没有 {}
  2. 函数有参数和返回值
type Writer interface {
    Write(p []byte) (n int, err error)
}