// Index finds all hypha files in the full `path` and saves them to the hypha storage.
funcIndex(pathstring){
ch:=make(chan*Hypha,5)
gofunc(chchan*Hypha){
indexHelper(path,0,ch)
close(ch)
}(ch)
forh:=rangech{
// At this time it is safe to ignore the mutex, because there is only one worker.
ifoldHypha,ok:=byNames[h.Name];ok{
oldHypha.MergeIn(h)
}else{
byNames[h.Name]=h
IncrementCount()
}
}
}
// indexHelper finds all hypha files in the full `path` and sends them to the channel. Handling of duplicate entries and attachment and counting them is up to the caller.