dapr / docs

Dapr user documentation, used to build docs.dapr.io
https://docs.dapr.io
Creative Commons Attribution 4.0 International
994 stars 726 forks source link

copy-paste error in golang example #4081

Closed anschoewe closed 5 months ago

anschoewe commented 6 months ago

URL of the docs page https://docs.dapr.io/developing-applications/building-blocks/workflow/workflow-patterns/

How is it currently worded?

    if err := ctx.CallActivity(Step1, workflow.ActivityInput(input)).Await(&result1); err != nil {
        return nil, err
    }
    var result2 int
    if err := ctx.CallActivity(Step1, workflow.ActivityInput(input)).Await(&result2); err != nil {
        return nil, err
    }
    var result3 int
    if err := ctx.CallActivity(Step1, workflow.ActivityInput(input)).Await(&result3); err != nil {
        return nil, err
    }

How should it be worded? The Step2 and Step3 should be passed into the last two calls to CallActivity(...). Right now it's passing Step1 to all three function invocations. I think it's just a copy/paste mistake.

    if err := ctx.CallActivity(Step1, workflow.ActivityInput(input)).Await(&result1); err != nil {
        return nil, err
    }
    var result2 int
    if err := ctx.CallActivity(Step2, workflow.ActivityInput(input)).Await(&result2); err != nil {
        return nil, err
    }
    var result3 int
    if err := ctx.CallActivity(Step3, workflow.ActivityInput(input)).Await(&result3); err != nil {
        return nil, err
    }