The following sections explain how common programming patterns and core concepts apply when authoring Lambda function code in Go.
Go runtimes
Name | Identifier | Operating system | Architectures |
---|---|---|---|
Go 1.x | go1.x |
Amazon Linux | x86_64 |
Note
Runtimes that use the Amazon Linux operating system, such as Go 1.x, do not support the arm64 architecture. To use arm64 architecture, you can run Go with the provided.al2 runtime.
Lambda provides the following tools and libraries for the Go runtime:
Tools and libraries for Go
- AWS SDK for Go: the official AWS SDK for the Go programming language.
- github.com/aws/aws-lambda-go/lambda: The implementation of the Lambda programming model for Go. This package is used by AWS Lambda to invoke your handler.
- github.com/aws/aws-lambda-go/lambdacontext: Helpers for accessing context information from the context object.
- github.com/aws/aws-lambda-go/events: This library provides type definitions for common event source integrations.
- github.com/aws/aws-lambda-go/cmd/build-lambda-zip: This tool can be used to create a .zip file archive on Windows.
For more information, see aws-lambda-go on GitHub.
Lambda provides the following sample applications for the Go runtime:
Sample Lambda applications in Go
- blank-go – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK.
Topics