Skip to content

Commit

Permalink
fix PathBuilder.Root() for non-chained method calls
Browse files Browse the repository at this point in the history
  • Loading branch information
tobb10001 committed Jan 15, 2024
1 parent ba40289 commit 716b6f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion path.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ type PathBuilder struct {
// Root add '$' to current path.
func (b *PathBuilder) Root() *PathBuilder {
root := newRootNode()
return &PathBuilder{root: root, node: root}
b.root = root
b.node = root
return b
}

// IndexAll add '[*]' to current path.
Expand Down

0 comments on commit 716b6f3

Please sign in to comment.