You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
w.Write([]byte(s)) working with a line of hundreds of megabytes.
What did you see instead?
Waiting forever on the following: w.Write([]byte(s))
The text was updated successfully, but these errors were encountered:
smartgolang
changed the title
affected/package:
os.Pipe() issue: a function to read a line from STDIN and output the line to STDOUT not able to write a line of size 100MB back to STDOUT
May 9, 2022
My function
func LargeDataLine(r io.Reader, w io.Writer) {
needs to write to STDOUT
I need a way to use the Golang testing framework
here how I'm calling it with the pipe redirection:
LargeDataLine(strings.NewReader(s), os.Stdout)
And unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
I don't think you've connected both ends of the pipe properly.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
// a function to read a line from STDIN and output the line to STDOUT
Testing:
Temporary redirecting Stdout
What did you expect to see?
w.Write([]byte(s)) working with a line of hundreds of megabytes.
What did you see instead?
Waiting forever on the following: w.Write([]byte(s))
The text was updated successfully, but these errors were encountered: