{"record":{"id":"c9e0d471c8967bdd","repo":"golangci/golangci-lint","slug":"can-t-eval-symlinks-on-wd-s-w","errorCode":null,"errorMessage":"can't eval symlinks on wd %s: %w","messagePattern":"can't eval symlinks on wd (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/fsutils/fsutils.go","lineNumber":39,"sourceCode":"\nfunc UseWdCache(use bool) {\n\tuseCache = use\n}\n\nfunc Getwd() (string, error) {\n\tif !useCache { // for tests\n\t\treturn os.Getwd()\n\t}\n\n\tgetWdOnce.Do(func() {\n\t\tcachedWd, cachedWdError = os.Getwd()\n\t\tif cachedWdError != nil {\n\t\t\treturn\n\t\t}\n\n\t\tevaluatedWd, err := EvalSymlinks(cachedWd)\n\t\tif err != nil {\n\t\t\tcachedWd, cachedWdError = \"\", fmt.Errorf(\"can't eval symlinks on wd %s: %w\", cachedWd, err)\n\t\t\treturn\n\t\t}\n\n\t\tcachedWd = evaluatedWd\n\t})\n\n\treturn cachedWd, cachedWdError\n}\n\nvar evalSymlinkCache sync.Map\n\ntype evalSymlinkRes struct {\n\tpath string\n\terr  error\n}\n\nfunc EvalSymlinks(path string) (string, error) {\n\tr, ok := evalSymlinkCache.Load(path)","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/fsutils/fsutils.go#L21-L57","documentation":"Error from fsutils.Getwd: the cached working directory was obtained via os.Getwd but EvalSymlinks on it failed (e.g. the working directory path contains a broken symlink or was deleted). The error is cached, so all later Getwd calls in the process return the same failure.","triggerScenarios":"Thrown at pkg/fsutils/fsutils.go:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the current working directory exists and its symlinks resolve","Recreate removed/renamed directories the shell still points at","cd to a valid directory before running golangci-lint"],"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"}