We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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了。
The text was updated successfully, but these errors were encountered:
因为Peek操作 会导致fill strings.NewReader的数据到bufio的buf中
Sorry, something went wrong.
No branches or pull requests
为啥使用了Peek 后 buf.Buffered()就不是0了。
The text was updated successfully, but these errors were encountered: