{"record":{"id":"924c7cc7999f8ba0","repo":"golang/go","slug":"reading-inputs-v","errorCode":null,"errorMessage":"reading inputs: %v","messagePattern":"reading inputs: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/internal/cov/readcovdata.go","lineNumber":134,"sourceCode":"\t// Invoked for each function  the package being visited.\n\tVisitFunc(pkgIdx uint32, fnIdx uint32, fd *coverage.FuncDesc)\n\n\t// Invoked when all counter + meta-data file processing is complete.\n\tFinish()\n}\n\ntype CovDataReaderFlags uint32\n\nconst (\n\tCovDataReaderNoFlags CovDataReaderFlags = 0\n\tPanicOnError                            = 1 << iota\n\tPanicOnWarning\n)\n\nfunc (r *CovDataReader) Visit() error {\n\tpodlist, err := pods.CollectPods(r.indirs, false)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading inputs: %v\", err)\n\t}\n\tif len(podlist) == 0 {\n\t\tr.warn(\"no applicable files found in input directories\")\n\t}\n\tfor _, p := range podlist {\n\t\tif err := r.visitPod(p); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tr.vis.Finish()\n\treturn nil\n}\n\nfunc (r *CovDataReader) verb(vlevel int, s string, a ...any) {\n\tif r.verbosityLevel >= vlevel {\n\t\tfmt.Fprintf(os.Stderr, s, a...)\n\t\tfmt.Fprintf(os.Stderr, \"\\n\")\n\t}","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/internal/cov/readcovdata.go#L116-L152","documentation":"Returned by CovDataReader.Visit when pods.CollectPods fails while scanning the input coverage directories (r.indirs). CollectPods walks the -coverpkg output directories looking for coverage meta-data and counter pods; any filesystem-level failure is wrapped with 'reading inputs' and propagated, aborting the visit.","triggerScenarios":"Running `go tool covdata` (or any caller of CovDataReader.Visit) with -indirs pointing at a path that errors during the pod walk — unreadable directory, permission denied, broken symlink, or a path that is a file rather than a directory.","commonSituations":"Passing a non-existent or permission-restricted -indirs value, pointing at a file instead of the coverage output directory, racing with `go test -cover` still writing counters, or moving the coverage tree mid-read.","solutions":["Confirm each -indirs path exists and is a readable directory: `ls -la <dir>`.","Ensure the user has read+execute permission on the coverage tree.","Wait for `go test -cover` runs to finish writing before processing.","Point -indirs at the actual coverage output root (typically the dir containing meta-data/counter files)."],"exampleFix":"// before\ngo tool covdata textfmt -i=/missing/path -o out.txt\n\n// after\ngo tool covdata textfmt -i=$(go env GOCOVERDIR) -o out.txt","handlingStrategy":"validation","validationCode":"for _, d := range indirs {\n    info, err := os.Stat(d)\n    if err != nil { return fmt.Errorf(\"indir %s: %w\", d, err) }\n    if !info.IsDir() { return fmt.Errorf(\"indir %s is not a directory\", d) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set GOCOVERDIR explicitly and pass it to -indirs.","Wait for `go test -cover` runs to complete before invoking covdata tools.","Ensure read+execute permissions on the entire coverage tree."],"tags":["coverage","covdata","filesystem","toolchain"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}