Skip to content

Commit 90c94e6

Browse files
when targeting a resource the associated actions should be run
1 parent a750471 commit 90c94e6

9 files changed

+933
-11
lines changed

internal/dag/dag.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ func (g *AcyclicGraph) Descendants(v Vertex) Set {
121121
return s
122122
}
123123

124+
// Children returns a Set of direct children of the provided starting Vertex v.
125+
func (g *AcyclicGraph) Children(v Vertex) Set {
126+
return g.upEdgesNoCopy(v)
127+
}
128+
124129
// FirstDescendantsWith returns a Set that includes every Vertex yielded by
125130
// walking up from the provided starting Vertex v, and stopping each branch when
126131
// match returns true. This will return the set of all first descendants

internal/dag/set.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,13 @@ func (s Set) List() iter.Seq[any] {
112112
func (s Set) Copy() Set {
113113
return maps.Clone(s)
114114
}
115+
116+
// Pop removes and returns an arbitrary element from the set.
117+
func (s Set) Pop() (interface{}, bool) {
118+
for k := range s {
119+
s.Delete(k)
120+
return k, true
121+
}
122+
123+
return nil, false
124+
}

0 commit comments

Comments
 (0)