有一个问题
Author: DevyingCreated Jan 31, 2019Updated Jun 5, 2019
sr := strings.NewReader("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890")
buf := bufio.NewReaderSize(sr, 0)
b := make([]byte, 10)
fmt.Println(buf.Buffered()) //
s, _ := buf.Peek(5)
s[0], s[1], s[2] = 'a', 'b', 'c'
fmt.Printf("%d %q\n", buf.Buffered(), s) 为啥使用了Peek 后 buf.Buffered()就不是0了。
Source: polaris1119/The-Golang-Standard-Library-by-Example