MCPcopy
hub / github.com/docker/compose / getAncestors

Function getAncestors

pkg/compose/dependencies.go:232–239  ·  view source on GitHub ↗

getAncestors return all descendents for a vertex, might contain duplicates

(v *Vertex)

Source from the content-addressed store, hash-verified

230
231// getAncestors return all descendents for a vertex, might contain duplicates
232func getAncestors(v *Vertex) []*Vertex {
233 var descendents []*Vertex
234 for _, parent := range v.GetParents() {
235 descendents = append(descendents, parent)
236 descendents = append(descendents, getAncestors(parent)...)
237 }
238 return descendents
239}
240
241// GetChildren returns a slice with the child vertices of the Vertex
242func (v *Vertex) GetChildren() []*Vertex {

Callers 1

WithRootNodesAndDownFunction · 0.85

Calls 1

GetParentsMethod · 0.80

Tested by

no test coverage detected