Skip to content

Instantly share code, notes, and snippets.

@mprokopov
Created May 12, 2020 08:00
Show Gist options
  • Select an option

  • Save mprokopov/e57f938262f87499a1edc910031441d0 to your computer and use it in GitHub Desktop.

Select an option

Save mprokopov/e57f938262f87499a1edc910031441d0 to your computer and use it in GitHub Desktop.
aws lambda example
package main
import (
"fmt"
"context"
"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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment