MCPcopy
hub / github.com/aws/aws-lambda-go / ExampleWithFunctionARN

Function ExampleWithFunctionARN

lambdacontext/example_logger_test.go:54–65  ·  view source on GitHub ↗

ExampleWithFunctionARN demonstrates using WithFunctionARN to include the function ARN.

()

Source from the content-addressed store, hash-verified

52
53// ExampleWithFunctionARN demonstrates using WithFunctionARN to include the function ARN.
54func ExampleWithFunctionARN() {
55 // Include only function ARN
56 slog.SetDefault(lambdacontext.NewLogger(
57 lambdacontext.WithFunctionARN(),
58 ))
59
60 lambda.Start(func(ctx context.Context) (string, error) {
61 // Log output will include "functionArn" field
62 slog.InfoContext(ctx, "function invoked")
63 return "success", nil
64 })
65}

Callers

nothing calls this directly

Calls 3

NewLoggerFunction · 0.92
WithFunctionARNFunction · 0.92
StartFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…