(content, baseDir string, extractTools bool)
| 60 | } |
| 61 | |
| 62 | func expandIncludesIteratively(content, baseDir string, extractTools bool) (string, map[string]struct { |
| 63 | }, error) { |
| 64 | const maxDepth = 10 |
| 65 | currentContent := content |
| 66 | visited := make(map[string]struct { |
| 67 | }) |
| 68 | for depth := range maxDepth { |
| 69 | includeExpanderLog.Printf("Include expansion depth: %d", depth) |
| 70 | processedContent, err := processIncludesWithVisited(currentContent, baseDir, extractTools, visited) |
| 71 | if err != nil { |
| 72 | return "", nil, err |
| 73 | } |
| 74 | if includeExpansionComplete(currentContent, processedContent, extractTools) { |
| 75 | currentContent = processedContent |
| 76 | break |
| 77 | } |
| 78 | currentContent = processedContent |
| 79 | } |
| 80 | return currentContent, visited, nil |
| 81 | } |
| 82 | |
| 83 | func includeExpansionComplete(currentContent, processedContent string, extractTools bool) bool { |
| 84 | if extractTools { |
no test coverage detected