Tee allows you to write to an io.Writer and to print to stdout as per issue 145. I have included code to script.go, as well as script_testing.go, and an example in the readme file.
Use:
SetStderr is a case I opened issue 128. I have also added some code to script.go, and script_testing.go. This allows you to set an io.writer to stderr so that both are not in the output. This solved the issue I had where my company uses in the /etc/ssh/sshd_config a directive: 'Banner /etc/corp_motd'. So if I wanted a report on the uptime of 20 servers, I just get the stdout and not the corp_motd mixed in.
Use:
Tee allows you to write to an io.Writer and to print to stdout as per issue 145. I have included code to script.go, as well as script_testing.go, and an example in the readme file. Use:
SetStderr is a case I opened issue 128. I have also added some code to script.go, and script_testing.go. This allows you to set an io.writer to stderr so that both are not in the output. This solved the issue I had where my company uses in the /etc/ssh/sshd_config a directive: 'Banner /etc/corp_motd'. So if I wanted a report on the uptime of 20 servers, I just get the stdout and not the corp_motd mixed in.
Use: