logginghandler/vendor/github.com/golangci/dupl/job/buildtree.go
Marvin Preuss d095180eb4
All checks were successful
continuous-integration/drone/push Build is passing
build: uses go modules for tool handling
2022-01-14 13:51:56 +01:00

23 lines
458 B
Go

package job
import (
"github.com/golangci/dupl/suffixtree"
"github.com/golangci/dupl/syntax"
)
func BuildTree(schan chan []*syntax.Node) (t *suffixtree.STree, d *[]*syntax.Node, done chan bool) {
t = suffixtree.New()
data := make([]*syntax.Node, 0, 100)
done = make(chan bool)
go func() {
for seq := range schan {
data = append(data, seq...)
for _, node := range seq {
t.Update(node)
}
}
done <- true
}()
return t, &data, done
}