> For the complete documentation index, see [llms.txt](https://denglj.gitbook.io/essential-go/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://denglj.gitbook.io/essential-go/02-basic-types/jie-kou.md).

# 接口

接口就是为结构体定义一组方法(method)。

接口的[零值](/essential-go/02-basic-types/ling-zhi.md)是`nil`。

下面是从标准库中摘录的[`io.Reader`](https://golang.org/pkg/io/#Reader)接口的定义：

```go
type Reader interface {
    Read(p []byte) (n int, err error)
}
```

接口越小越好。

学习更多关于[接口](/essential-go/11-interfaces.md)的知识。
