{"record":{"id":"88e35be05badeeba","repo":"golangci/golangci-lint","slug":"can-t-eval-symlinks-for-path-s-w","errorCode":null,"errorMessage":"can't eval symlinks for path %s: %w","messagePattern":"can't eval symlinks for path (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/fsutils/fsutils.go","lineNumber":81,"sourceCode":"\tvar er evalSymlinkRes\n\ter.path, er.err = evalSymlinks(path)\n\tevalSymlinkCache.Store(path, er)\n\n\treturn er.path, er.err\n}\n\nfunc ShortestRelPath(path, wd string) (string, error) {\n\tif wd == \"\" { // get it if user don't have cached working dir\n\t\tvar err error\n\t\twd, err = Getwd()\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"can't get working directory: %w\", err)\n\t\t}\n\t}\n\n\tevaluatedPath, err := EvalSymlinks(path)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"can't eval symlinks for path %s: %w\", path, err)\n\t}\n\tpath = evaluatedPath\n\n\t// make path absolute and then relative to be able to fix this case:\n\t// we are in `/test` dir, we want to normalize `../test`, and have file `file.go` in this dir;\n\t// it must have normalized path `file.go`, not `../test/file.go`,\n\tvar absPath string\n\tif filepath.IsAbs(path) {\n\t\tabsPath = path\n\t} else {\n\t\tabsPath = filepath.Join(wd, path)\n\t}\n\n\trelPath, err := filepath.Rel(wd, absPath)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"can't get relative path for path %s and root %s: %w\",\n\t\t\tabsPath, wd, err)\n\t}","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/fsutils/fsutils.go#L63-L99","documentation":"Wrapping error in ShortestRelPath: EvalSymlinks(path) failed for the target path — a symlink component is broken or the path does not exist — so the path cannot be normalized to its shortest relative form.","triggerScenarios":"Thrown at pkg/fsutils/fsutils.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the path exists and all symlink components resolve","Remove or fix broken symlinks","Check the path is not deleted between listing and processing"],"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"}