Skip to content

Commit

Permalink
feat: Add support for golang workspace (#1738)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideSegullo authored Oct 3, 2023
1 parent da06a80 commit b8f99fb
Show file tree
Hide file tree
Showing 15 changed files with 12,441 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/golang-lambda/functions/ping.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"context"

"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)

func GenerateResponse(Body string, Code int) events.APIGatewayProxyResponse {
return events.APIGatewayProxyResponse{Body: Body, StatusCode: Code}
}

func HandleRequest(_ context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
return GenerateResponse("Pong", 200), nil
}

func main() {
lambda.Start(HandleRequest)
}
5 changes: 5 additions & 0 deletions examples/golang-lambda/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module golang-lambda

go 1.20

require github.com/aws/aws-lambda-go v1.41.0
6 changes: 6 additions & 0 deletions examples/golang-lambda/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/aws/aws-lambda-go v1.41.0 h1:l/5fyVb6Ud9uYd411xdHZzSf2n86TakxzpvIoz7l+3Y=
github.com/aws/aws-lambda-go v1.41.0/go.mod h1:jwFe2KmMsHmffA1X2R09hH6lFzJQxzI8qK17ewzbQMM=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Loading

0 comments on commit b8f99fb

Please sign in to comment.