(
directive *ImportDirectiveMatch,
baseDir string,
extractTools bool,
visited map[string]struct {
})
| 79 | } |
| 80 | |
| 81 | func processIncludeDirectiveWithVisited( |
| 82 | directive *ImportDirectiveMatch, |
| 83 | baseDir string, |
| 84 | extractTools bool, |
| 85 | visited map[string]struct { |
| 86 | }) (string, bool, error) { |
| 87 | emitIncludeDirectiveDeprecationWarning(directive) |
| 88 | resolution, shouldSkip, err := resolveDirectiveWithVisited(directive, baseDir, extractTools, visited) |
| 89 | if err != nil || shouldSkip { |
| 90 | return "", shouldSkip, err |
| 91 | } |
| 92 | |
| 93 | includeLog.Printf("Processing include file: %s", resolution.fullPath) |
| 94 | visited[resolution.fullPath] = struct { |
| 95 | }{} |
| 96 | |
| 97 | includedContent, err := processIncludedFileWithVisited(resolution.fullPath, resolution.sectionName, extractTools, visited) |
| 98 | if err != nil { |
| 99 | return "", false, fmt.Errorf("failed to process included file '%s': %w", resolution.fullPath, err) |
| 100 | } |
| 101 | return includedContent, false, nil |
| 102 | } |
| 103 | |
| 104 | func emitIncludeDirectiveDeprecationWarning(directive *ImportDirectiveMatch) { |
| 105 | if !directive.IsLegacy { |
no test coverage detected