(regex *regexp.Regexp, inputs map[string]any)
| 1343 | } |
| 1344 | |
| 1345 | func buildImportInputReplaceFunc(regex *regexp.Regexp, inputs map[string]any) func(string) string { |
| 1346 | return func(match string) string { |
| 1347 | m := regex.FindStringSubmatch(match) |
| 1348 | if len(m) < 2 { |
| 1349 | return match |
| 1350 | } |
| 1351 | strVal, found := resolveImportInputPath(inputs, m[1]) |
| 1352 | if found { |
| 1353 | return strVal |
| 1354 | } |
| 1355 | return match |
| 1356 | } |
| 1357 | } |
| 1358 | |
| 1359 | func resolveImportInputPath(inputs map[string]any, inputPath string) (string, bool) { |
| 1360 | value, ok := resolveImportInputValue(inputs, inputPath) |
no test coverage detected