In the second episode of Serverless Office Hours, I show you how to use dependency injection and pointer receiver functions to unit test your AWS Lambda functions in Go. I also compare performance test results of initializing dependencies in your main function versus your Lambda handler function.
Topics covered:
(2:04) Installing the AWS SAM CLI - https://docs.aws.amazon.com/serverles...
(2:23) Creating a SAM app - https://docs.aws.amazon.com/serverles...
(4:00) Anatomy of an AWS Lambda function in Go - https://docs.aws.amazon.com/lambda/la...
(11:11) Receiver functions and dependency injection - https://tour.golang.org/methods/4
(14:00) Writing unit tests
(31:05) Initializing AWS resources in func main() vs. func handler()
AWS products and services covered:
AWS Lambda - https://aws.amazon.com/lambda/
AWS SAM CLI - https://github.com/awslabs/aws-sam-cli/
Questions? My DMs are open! - / rts_rob
Rob Sutter, Sr. Developer Advocate, AWS Serverless