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
The reason I propose this API is similar with this.
Stdout is used globally and if we forget to restore the Stdout, many tests would be effected by this. So I think it's better approach to prevent it by to provide TB.SetStdout(). And there are a few codes that use this case in Go core. So I think it's common approach when we want to check stdout by go test.
As another idea, it might be good to check by static analysis.
Thanks.
The text was updated successfully, but these errors were encountered:
Proposal Details
I propose to add SetStdout to testing package.
If we want to test about Stdout, we must write like below.
The reason I propose this API is similar with this.
Stdout is used globally and if we forget to restore the Stdout, many tests would be effected by this. So I think it's better approach to prevent it by to provide TB.SetStdout(). And there are a few codes that use this case in Go core. So I think it's common approach when we want to check stdout by go test.
As another idea, it might be good to check by static analysis.
Thanks.
The text was updated successfully, but these errors were encountered: