package main import ( "context" "errors" "testing" ) func TestRunWiresCallbacksServiceAndPropagatesError(t *testing.T) { want := errors.New("synthetic callbacks failure") ctx := context.WithValue(context.Background(), struct{}{}, "request-context") err := run(ctx, func(gotContext context.Context, serviceName string) error { if gotContext != ctx || serviceName != "callbacks" { t.Fatalf("context=%v service=%q", gotContext, serviceName) } return want }) if !errors.Is(err, want) { t.Fatalf("run error=%v", err) } }