Debian Codegraph @

internal/graph/reachable.go

raw symbols SCIP
1 // Copyright 2026 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package graphscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/graph`/
6
7 // Reachable returns the set of nodes reachable from the given roots.
8 func Reachablescip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/graph`/Reachable().[NodeID comparable](g Graphscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/graph`/Graph#[NodeID], roots ...NodeID) map[NodeID]bool {
9 seen := make(map[NodeID]bool)
10 var visit func(node NodeID)
11 visit = func(node NodeID) {
12 if !seen[node] {
13 seen[node] = true
14 for e := range g.Outscip-go gomod golang.org/x/tools . `golang.org/x/tools/internal/graph`/Graph#Out.(node) {
15 visit(e)
16 }
17 }
18 }
19 for _, root := range roots {
20 visit(root)
21 }
22 return seen
23 }