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

Function enqueueNestedVisitedPath

pkg/parser/import_bfs.go:468–483  ·  view source on GitHub ↗
(state *importBFSState, nestedImportPath, nestedFullPath, nestedSectionName, baseDir string, inputs map[string]any, nestedRemoteOrigin *remoteImportOrigin)

Source from the content-addressed store, hash-verified

466}
467
468func enqueueNestedVisitedPath(state *importBFSState, nestedImportPath, nestedFullPath, nestedSectionName, baseDir string, inputs map[string]any, nestedRemoteOrigin *remoteImportOrigin) error {
469 if !setutil.Contains(state.visited, nestedFullPath) {
470 state.visited[nestedFullPath] = struct{}{}
471 state.visitedInputs[nestedFullPath] = inputs
472 state.queue = append(state.queue, importQueueItem{
473 importPath: nestedImportPath, fullPath: nestedFullPath, sectionName: nestedSectionName, baseDir: baseDir, inputs: inputs, remoteOrigin: nestedRemoteOrigin,
474 })
475 parserLog.Printf("Discovered nested import: %s (queued)", nestedFullPath)
476 return nil
477 }
478 if err := checkImportInputsConsistency(nestedImportPath, state.visitedInputs[nestedFullPath], inputs); err != nil {
479 return err
480 }
481 parserLog.Printf("Skipping already visited nested import: %s (cycle detected)", nestedFullPath)
482 return nil
483}
484
485// parseImportSpecsFromArray parses an []any slice into a list of ImportSpec values.
486// Each element must be a string (simple path) or a map with a required "path" or "uses"

Callers 1

enqueueNestedImportEntryFunction · 0.85

Calls 3

ContainsFunction · 0.92
PrintfMethod · 0.45

Tested by

no test coverage detected