I am trying to test whether a function, which is capable of printing to stdout using the "os" package's stdout variable, actually prints to stdout. I ran this function and I found that it does print to the stdout. Now I am trying to figure out how to prove that this function prints to stdout using golang code. Could I possibly use the "os" package's stdout variable to check whether stdout has been written to after calling one of the functions in the array?
I tried to figure out whether stdout had been written to by calling the Stat() method on the os.stdout variable in order to have access to the size and last modified time of stdout, but the size and last modified time did not reflect the fact that a function had written to the stdout.