Skip to content

Commit

Permalink
Allow zero value for contextualized vars (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored May 9, 2023
1 parent 0778af4 commit 7ccc8e9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,11 @@ func (c *Client) Fork(ctx context.Context) (context.Context, *Client) {
cc := *c
fc := &cc
fc.JSONComparer = c.JSONComparer
ctx, fc.JSONComparer.Vars = c.JSONComparer.Vars.Fork(ctx)
ctx = context.WithValue(ctx, c, fc)

fc.Reset().WithContext(ctx)

if c.JSONComparer.Vars != nil {
ctx, fc.JSONComparer.Vars = c.JSONComparer.Vars.Fork(ctx)
}

ctx = context.WithValue(ctx, c, fc)

return ctx, fc
}

Expand Down

0 comments on commit 7ccc8e9

Please sign in to comment.