Skip to content

Commit

Permalink
fix(machine): allow for nil ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
pancsta committed Jul 10, 2024
1 parent 6d7a029 commit 177270d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/machine/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ func New(ctx context.Context, statesStruct Struct, opts *Opts) *Machine {
m.clock[name] = 0
}

// init context
// init context (support nil for examples)
if ctx == nil {
panic("machine ctx is required")
ctx = context.TODO()
}
if parent != nil {
m.ParentID = parent.ID
Expand Down

0 comments on commit 177270d

Please sign in to comment.