golang-101-hacks(26)——io.Writer interface
注:本文是对golang-101-hacks中文翻译 与io.Reader 接口相对应的就是 io.Writer接口了 type Writer interface { Write(p []byte) (n int, err error) } 与io.Reader相比,不需要考虑io.EOF 错误, Write方法很简单: Compared to io.Reader, since you no need to consider io.EOF error, the process of Writemethod is simple: 当err == nil 表示所有数据写入成功 (1) err == nil: All the data in p is written successfully; (...阅读全文