github.com/mweagle/Sparta@v1.15.0/doc_newmain_test.go (about) 1 package sparta 2 3 import "context" 4 5 // NOTE: your application MUST use `package main` and define a `main()` function. The 6 // example text is to make the documentation compatible with godoc. 7 // Should be main() in your application 8 9 func mainHelloWorld(ctx context.Context) (string, error) { 10 return "Hello World!", nil 11 } 12 13 func ExampleMain_basic() { 14 var lambdaFunctions []*LambdaAWSInfo 15 helloWorldLambda, _ := NewAWSLambda("PreexistingAWSLambdaRoleName", 16 mainHelloWorld, 17 IAMRoleDefinition{}) 18 19 lambdaFunctions = append(lambdaFunctions, helloWorldLambda) 20 Main("HelloWorldLambdaService", "Description for Hello World Lambda", lambdaFunctions, nil, nil) 21 }