Golang Stack Trace on Error
June 22, 2015
One of the great features of Go is its testing package. The testing package has streamlined our unit-testing and test-driven development.
One addition we found useful was the implementation of stack-traces on certain types of errors. Since our testing suite consisted of a lot of functions that were called repeatedly, tracing out the stack made tracking down failed tests much easier.
Here’s how to implement a stack trace in Golang: