Reputation: 561
I have some unit test that deadlocks for some reason. I want to stop the running unit test, and see the messages(t.Log). If I just do CTRL-C I don't get the messages.
Upvotes: 2
Views: 74
Reputation: 1434
You should use the -v
flag with go test
, e.g. go test -v github.com/myname/package
This will cause the any logging to be output as the tests are run.
Upvotes: 1
Reputation: 6545
You can do CTRL-\ and it will give you a backtrace of where it's hung. I'm not sure if there's a clean way to get the log messages though.
Upvotes: 1