When writing tests in Go, there are a few useful ways to get info printed out to the screen.
t.log
Inside the test, you can log stuff using t.log
. This will only show up if you use the -v
flag when running go test
.
- fmt.PrintLn
Inside the actual program itself, you can print things using an fmt.Print
command, and running the tests with the -v
flag.
Basically, the -v
flag is your friend when you want to see things in your go tests!