| 810 | } |
| 811 | |
| 812 | func (node *ModTreeNode) moduleLocalPathString() string { |
| 813 | path := node.Path() |
| 814 | if len(path) == 0 { |
| 815 | return "" |
| 816 | } |
| 817 | |
| 818 | root := node |
| 819 | for root.Parent != nil && root.Parent.Module.Self() != nil { |
| 820 | root = root.Parent |
| 821 | } |
| 822 | |
| 823 | // Workspace checks reparent each module tree under a synthetic naming-only |
| 824 | // root. Scale-out loads the module directly, so the remote check/generator |
| 825 | // lookup must use the name relative to that module. |
| 826 | if root.Parent != nil && root.Parent.Module.Self() == nil && path[0] == root.Name { |
| 827 | path = path[1:] |
| 828 | } |
| 829 | return strings.Join(path.CliCase(), ":") |
| 830 | } |
| 831 | |
| 832 | type WalkFunc func(context.Context, *ModTreeNode) (bool, error) |
| 833 | |