MCPcopy Create free account
hub / github.com/docker/compose / Leaves

Method Leaves

pkg/compose/dependencies.go:335–347  ·  view source on GitHub ↗

Leaves returns the slice of leaves of the graph

()

Source from the content-addressed store, hash-verified

333
334// Leaves returns the slice of leaves of the graph
335func (g *Graph) Leaves() []*Vertex {
336 g.lock.Lock()
337 defer g.lock.Unlock()
338
339 var res []*Vertex
340 for _, v := range g.Vertices {
341 if len(v.Children) == 0 {
342 res = append(res, v)
343 }
344 }
345
346 return res
347}
348
349// Roots returns the slice of "Roots" of the graph
350func (g *Graph) Roots() []*Vertex {

Callers

nothing calls this directly

Calls 1

LockMethod · 0.45

Tested by

no test coverage detected