Skip to content

Commit

Permalink
Do not return error from struct constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Dec 3, 2024
1 parent 3ac2c46 commit 318bc38
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions early-return/starter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ func main() {

tx := earlyreturn.Transaction{ID: uuid.New(), SourceAccount: "Bob", TargetAccount: "Alice", Amount: 100}

startWorkflowOp, err := c.NewWithStartWorkflowOperation(client.StartWorkflowOptions{
startWorkflowOp := c.NewWithStartWorkflowOperation(client.StartWorkflowOptions{

Check failure on line 26 in early-return/starter/main.go

View workflow job for this annotation

GitHub Actions / build-and-test

c.NewWithStartWorkflowOperation undefined (type client.Client has no field or method NewWithStartWorkflowOperation)
ID: "early-return-workflow-ID-" + tx.ID,
WorkflowIDConflictPolicy: enumspb.WORKFLOW_ID_CONFLICT_POLICY_FAIL,
TaskQueue: earlyreturn.TaskQueueName,
}, earlyreturn.Workflow, tx)
if err != nil {
// E.g. missing conflict policy, or workflow arguments do not match workflow definition.
log.Fatalln("Error creating start workflow operation:", err)
}

updateHandle, err := c.UpdateWithStartWorkflow(ctxWithTimeout, client.UpdateWorkflowOptions{

Check failure on line 32 in early-return/starter/main.go

View workflow job for this annotation

GitHub Actions / build-and-test

c.UpdateWithStartWorkflow undefined (type client.Client has no field or method UpdateWithStartWorkflow) (compile)
UpdateName: earlyreturn.UpdateName,
Expand Down

0 comments on commit 318bc38

Please sign in to comment.