Skip to content

Commit

Permalink
fix concurrency issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Sep 13, 2024
1 parent 7369c95 commit 12abec7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions walk/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func (t *pathTrie) Get(key string) *pathTrie {
return node
}

func (t *pathTrie) AddChild(entry *fs.DirEntry) *pathTrie {
func (t *pathTrie) AddChild(entry fs.DirEntry) *pathTrie {
if t.children == nil {
t.children = map[string]*pathTrie{}
}

child := &pathTrie{entry: entry}
t.children[(*entry).Name()] = child
child := &pathTrie{entry: &entry}
t.children[entry.Name()] = child
return child
}
2 changes: 1 addition & 1 deletion walk/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func walkDir(root, rel string, eg *errgroup.Group, isIgnored isIgnoredFunc, trie
continue
}

childTrie := trie.AddChild(&d1)
childTrie := trie.AddChild(d1)

if d1.IsDir() {
eg.Go(func() error {
Expand Down

0 comments on commit 12abec7

Please sign in to comment.