I was working on a configuration loader library last night and came across a problem when testing where I needed to see the logs printed by the function being tested. Here's how I did it.
https://dev.to/keystroke3/how-to-read-a-functions-stdout-logs-in-go-tests-22d6
How to read a function's Stdout logs in Go tests

Being able to read the output of a function can be useful to read some good your tests are failing....

DEV Community