Unit testing your Lambda function means testing the function handler in total isolation (as far as possible) from external resources (such as the following events: DynamoDB, S3, Kinesis). These tests allow you to catch bugs before actually deploying your new changes to production and maintain the quality, reliability, and security of your source code.
Before we write our first unit test, some background about testing in Golang might be helpful. To write a new test suite in Go, the filename must end with _test.go and contain the functions with a TestFUNCTIONNAME prefix. The Test prefix helps to identify the test routine. The files that end with the _test suffix will be excluded while building the deployment package and will be executed only if the go test command is issued. In addition, Go comes with a built-in testing package with a lot of helper functions. However...