{"record":{"id":"70f9321a570d465e","repo":"JuliusBrussee/caveman","slug":"windows-only-process-query-on-s-build","errorCode":null,"errorMessage":"windows-only process query on %s build","messagePattern":"windows-only process query on (.+?) build","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/internal/runstate/runstate_notwindows.go","lineNumber":10,"sourceCode":"//go:build !windows\n\npackage runstate\n\nimport \"fmt\"\n\n// processExecutableWindows is only reachable behind a runtime.GOOS check; this\n// stub keeps non-Windows builds compiling without the x/sys/windows import.\nfunc processExecutableWindows(int) (string, error) {\n\treturn \"\", fmt.Errorf(\"windows-only process query on %s build\", \"non-windows\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":12,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/proxy/internal/runstate/runstate_notwindows.go#L1-L12","documentation":"This is the non-Windows build stub for processExecutableWindows. The real Windows implementation lives behind a build tag; on other platforms this stub always returns an error so non-Windows builds compile without the x/sys/windows import. It is unreachable at runtime because processExecutable checks runtime.GOOS first.","triggerScenarios":"Only reachable if the runtime.GOOS=='windows' guard in processExecutable is bypassed — e.g. calling processExecutableWindows directly in tests or new code on a non-Windows build.","commonSituations":"Unit tests on Linux/macOS that call the windows-only helper directly, or new callers skipping the GOOS check.","solutions":["Do not call processExecutableWindows directly; go through processExecutable which gates on runtime.GOOS","Put windows-only callers in _windows.go files so they never compile elsewhere","Guard new call sites with runtime.GOOS == \"windows\""],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if runtime.GOOS != \"windows\" { // never call processExecutableWindows off-Windows\n    return \"\", nil\n}","typeGuard":null,"tryCatchPattern":"exe, err := processExecutableWindows(pid)\nif err != nil {\n    return fmt.Errorf(\"identity unavailable on this build: %w\", err)\n}","preventionTips":["Route all identity queries through processExecutable","Keep windows-only code in _windows.go files","Never bypass the runtime.GOOS gate","Cover non-Windows builds in CI"],"tags":["windows","build-tags","platform"],"backgroundTag":"unsupported-platform","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}