{"record":{"id":"568bc9870edbb746","repo":"golangci/golangci-lint","slug":"can-t-get-file-s-bytes-from-cache-w","errorCode":null,"errorMessage":"can't get file %s bytes from cache: %w","messagePattern":"can't get file (.+?) bytes from cache: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/fsutils/linecache.go","lineNumber":62,"sourceCode":"\t\treturn nil, fmt.Errorf(\"invalid file line index0 < 0: %d\", index0)\n\t}\n\n\tif index0 >= len(fc) {\n\t\treturn nil, fmt.Errorf(\"invalid file line index0 (%d) >= len(fc) (%d)\", index0, len(fc))\n\t}\n\n\treturn fc[index0], nil\n}\n\nfunc (lc *LineCache) getFileCache(filePath string) (fileLinesCache, error) {\n\tloadedFc, ok := lc.files.Load(filePath)\n\tif ok {\n\t\treturn loadedFc.(fileLinesCache), nil\n\t}\n\n\tfileBytes, err := lc.fileCache.GetFileBytes(filePath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"can't get file %s bytes from cache: %w\", filePath, err)\n\t}\n\n\tfc := bytes.Split(fileBytes, []byte(\"\\n\"))\n\tlc.files.Store(filePath, fileLinesCache(fc))\n\treturn fc, nil\n}\n","sourceCodeStart":44,"sourceCodeEnd":69,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/fsutils/linecache.go#L44-L69","documentation":"Wrapping error in LineCache.getFileCache: FileCache.GetFileBytes failed while loading the file's bytes (file missing/unreadable — see the wrapped os error). The line lookup aborts since the file content cannot be split into a line cache.","triggerScenarios":"Thrown at pkg/fsutils/linecache.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file exists and is readable at the reported path","Check the wrapped underlying error for the exact read failure","Ensure working-directory/relative-path resolution is correct"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}