阅读并校对12.1 到 12.7

This commit is contained in:
dake
2015-10-31 18:08:57 +08:00
parent 0c9e7b90db
commit 3f1611132c
8 changed files with 50 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
# 用切片读写文件
切片提供了标准的Go方法来处理I/O缓冲下面`cat`函数的第二版中,在一个切片缓冲内使用无线for循环直到文件尾部EOF读取文件并写入到标准输出。
切片提供了 Go 中处理 I/O 缓冲的标准方式,下面 `cat` 函数的第二版中,在一个切片缓冲内使用无for 循环(直到文件尾部 EOF读取文件并写入到标准输出`os.Stdout`
```go
func cat(f *os.File) {
@@ -22,7 +22,7 @@ func cat(f *os.File) {
}
```
代码来自于`cat2.go`使用了os包中的`os.file``Read`方法;`cat2.go``cat.go`具有同样的功能。
下面的代码来自于 `cat2.go`,使用了 os 包中的 `os.file``Read` 方法;`cat2.go``cat.go` 具有同样的功能。
示例 12.14 [cat2.go](examples/chapter_12/cat2.go)
@@ -75,5 +75,5 @@ func main() {
## 链接
- [目录](directory.md)
- 上一节:[用buffer读取文件](12.5.md)
- 下一节:[用defer关闭文件](12.7.md)
- 上一节:[ buffer 读取文件](12.5.md)
- 下一节:[ defer 关闭文件](12.7.md)