Skip to content

Commit d222b79

Browse files
committed
fix: workflow returns a string
1 parent d3eb667 commit d222b79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/01-get-started/03-golang-hello-world.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ You may see this because there are no activities and workflows registered to the
142142
Let's write a hello world activity, which take a single input called `name` and greet us after the workflow is finished.
143143

144144
```go
145-
func helloWorldWorkflow(ctx workflow.Context, name string) error {
145+
func helloWorldWorkflow(ctx workflow.Context, name string) (*string, error) {
146146
ao := workflow.ActivityOptions{
147147
ScheduleToStartTimeout: time.Minute,
148148
StartToCloseTimeout: time.Minute,
@@ -156,12 +156,12 @@ func helloWorldWorkflow(ctx workflow.Context, name string) error {
156156
err := workflow.ExecuteActivity(ctx, helloWorldActivity, name).Get(ctx, &helloworldResult)
157157
if err != nil {
158158
logger.Error("Activity failed.", zap.Error(err))
159-
return err
159+
return nil, err
160160
}
161161

162162
logger.Info("Workflow completed.", zap.String("Result", helloworldResult))
163163

164-
return nil
164+
return &helloworldResult, nil
165165
}
166166

167167
func helloWorldActivity(ctx context.Context, name string) (string, error) {

0 commit comments

Comments
 (0)