We'll use this in an upcoming PR for sorting the dependency graph of template installations, which matters when a template outputs another template.
Ideally we wouldn't write this ourselves, but the main graph library seems to be gonum and it just defines interfaces that we have to implement ourselves, at the cost of lots of boilerplate (example). We can do the algorithm ourselves easily.
We'll use this in an upcoming PR for sorting the dependency graph of template installations, which matters when a template outputs another template.
Ideally we wouldn't write this ourselves, but the main graph library seems to be
gonum
and it just defines interfaces that we have to implement ourselves, at the cost of lots of boilerplate (example). We can do the algorithm ourselves easily.