Skip to content

Commit

Permalink
Merge pull request #202 from liaosunny123/patch-2
Browse files Browse the repository at this point in the history
Update ch7-01.md
  • Loading branch information
chai2010 authored Aug 11, 2023
2 parents d948a26 + 213fe7c commit bb175c6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ch7/ch7-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ func Sprintf(format string, args ...interface{}) string {
}
```

Fprintf的前缀F表示文件(File)也表明格式化输出结果应该被写入第一个参数提供的文件中。在Printf函数中的第一个参数os.Stdout是`*os.File`类型;在Sprintf函数中的第一个参数&buf是一个指向可以写入字节的内存缓冲区,然而它
并不是一个文件类型尽管它在某种意义上和文件类型相似。
Fprintf的前缀F表示文件(File),也表明格式化输出结果应该被写入第一个参数提供的文件中。在Printf函数中的第一个参数os.Stdout是`*os.File`类型;在Sprintf函数中的第一个参数&buf是一个指向可以写入字节的内存缓冲区。然而它并不是一个文件类型,尽管它在某种意义上和文件类型相似。

即使Fprintf函数中的第一个参数也不是一个文件类型。它是io.Writer类型,这是一个接口类型定义如下:
即使是Fprintf函数中的第一个参数,它也不是一个文件类型。它是io.Writer类型,这是一个接口类型定义如下:

``` go
package io
Expand Down

0 comments on commit bb175c6

Please sign in to comment.