MCPcopy Create free account
hub / github.com/github/gh-aw / buildImportInputReplaceFunc

Function buildImportInputReplaceFunc

pkg/parser/import_field_extractor.go:1345–1357  ·  view source on GitHub ↗
(regex *regexp.Regexp, inputs map[string]any)

Source from the content-addressed store, hash-verified

1343}
1344
1345func 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
1359func resolveImportInputPath(inputs map[string]any, inputPath string) (string, bool) {
1360 value, ok := resolveImportInputValue(inputs, inputPath)

Callers 1

Calls 1

resolveImportInputPathFunction · 0.70

Tested by

no test coverage detected