Skip to content

Commit

Permalink
topdown/json: Add clarifying comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
  • Loading branch information
philipaconrad committed Sep 29, 2022
1 parent d1acc16 commit 586185d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion topdown/json.go
Expand Up @@ -203,11 +203,12 @@ func pathsToObject(paths []ast.Ref) ast.Object {
node := root
var done bool

// If it's a null JSON path, skip all further processing.
// If the path is an empty JSON path, skip all further processing.
if len(path) == 0 {
done = true
}

// Otherwise, we should have 1+ path segments to work with.
for i := 0; i < len(path)-1 && !done; i++ {

k := path[i]
Expand Down

0 comments on commit 586185d

Please sign in to comment.