@@ -275,7 +275,7 @@ func evaluateGraphExpression(l log.Logger, expr *GraphExpression, components com
275275 }
276276
277277 for _ , target := range targetMatches {
278- traverseGraph (l , target , resultSet , visited , graphDirectionDependencies , depth , warnOnLimit )
278+ traverseGraph (l , target , resultSet , visited , GraphDirectionDependencies , depth , warnOnLimit )
279279 }
280280 }
281281
@@ -291,7 +291,7 @@ func evaluateGraphExpression(l log.Logger, expr *GraphExpression, components com
291291 }
292292
293293 for _ , target := range targetMatches {
294- traverseGraph (l , target , resultSet , visited , graphDirectionDependents , depth , warnOnLimit )
294+ traverseGraph (l , target , resultSet , visited , GraphDirectionDependents , depth , warnOnLimit )
295295 }
296296 }
297297
@@ -322,25 +322,6 @@ func evaluateGitFilter(filter *GitExpression, components component.Components) (
322322 return results , nil
323323}
324324
325- // graphDirection represents the direction of graph traversal.
326- type graphDirection int
327-
328- const (
329- graphDirectionDependencies graphDirection = iota
330- graphDirectionDependents
331- )
332-
333- func (d graphDirection ) String () string {
334- switch d {
335- case graphDirectionDependencies :
336- return "dependencies"
337- case graphDirectionDependents :
338- return "dependents"
339- }
340-
341- return "unknown"
342- }
343-
344325// traverseGraph recursively traverses the graph in the specified direction (dependencies or dependents).
345326// The visited map tracks the maximum remaining depth at which each node was visited, allowing re-traversal
346327// when a node is reached with more remaining depth (e.g., from a closer target).
@@ -350,7 +331,7 @@ func traverseGraph(
350331 c component.Component ,
351332 resultSet map [string ]component.Component ,
352333 visited map [string ]int ,
353- direction graphDirection ,
334+ direction GraphDirection ,
354335 remainingDepth int ,
355336 warnOnLimit bool ,
356337) {
@@ -379,7 +360,7 @@ func traverseGraph(
379360 visited [path ] = remainingDepth
380361
381362 var relatedComponents []component.Component
382- if direction == graphDirectionDependencies {
363+ if direction == GraphDirectionDependencies {
383364 relatedComponents = c .Dependencies ()
384365 } else {
385366 relatedComponents = c .Dependents ()
0 commit comments