Skip to content

Commit d3c5487

Browse files
author
EC2 Default User
committed
Updated readme to use ProxyWithContext method
1 parent 4e8766f commit d3c5487

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package main
2121

2222
import (
2323
"log"
24+
"context"
2425

2526
"github.com/aws/aws-lambda-go/events"
2627
"github.com/aws/aws-lambda-go/lambda"
@@ -43,9 +44,9 @@ func init() {
4344
ginLambda = ginadapter.New(r)
4445
}
4546

46-
func Handler(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
47+
func Handler(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
4748
// If no name is provided in the HTTP request body, throw an error
48-
return ginLambda.Proxy(req)
49+
return ginLambda.ProxyWithContext(ctx, req)
4950
}
5051

5152
func main() {

0 commit comments

Comments
 (0)