github.com/mweagle/Sparta@v1.15.0/doc_newlambda1_test.go (about) 1 package sparta 2 3 import ( 4 "fmt" 5 "net/http" 6 ) 7 8 func lambdaHelloWorld(w http.ResponseWriter, r *http.Request) { 9 fmt.Fprintf(w, "Hello World!") 10 } 11 12 func ExampleHandleAWSLambda_preexistingIAMRoleName() { 13 helloWorldLambda, _ := NewAWSLambda(LambdaName(lambdaHelloWorld), 14 lambdaHelloWorld, 15 IAMRoleDefinition{}) 16 if nil != helloWorldLambda { 17 fmt.Printf("Failed to create new Lambda function") 18 } 19 }