python doesn't seem to work, let's see how go handles things

This commit is contained in:
Nathan Windisch 2025-03-10 01:24:48 +00:00
parent f9520551be
commit d27d1b3034
4 changed files with 25 additions and 2 deletions

View File

@ -1,2 +0,0 @@
def handler(event, context):
return {"Hello": "world!"}

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module app
go 1.22
require github.com/aws/aws-lambda-go v1.29.0

20
main.go Normal file
View File

@ -0,0 +1,20 @@
package main
import (
"context"
"fmt"
"github.com/aws/aws-lambda-go/lambda"
)
type MyEvent struct {
Name string `json:"name"`
}
func HandleRequest(ctx context.Context, name MyEvent) (string, error) {
return fmt.Sprintf("Hello %s!", name.Name), nil
}
func main() {
lambda.Start(HandleRequest)
}

View File