testing: examples do not always capture stdout #12348
Closed
Labels
Comments
I think this is reasonable limitation, f is assigned before the
testing package can replace it. If the example author does
this, then it's probably intentional to bypass the output
capture.
|
CL https://golang.org/cl/13927 mentions this issue. |
It doesn't work, so, don't do that. Examples are a convenience feature for documentation, not something that has to work no matter what the program does. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Examples do not capture stdout when os.Stdout is assigned to a variable outside the example body:
The text was updated successfully, but these errors were encountered: