{"record":{"id":"d884870693ca9dee","repo":"zed-industries/zed","slug":"failed-to-install-gopls-with-go-install-is-go","errorCode":null,"errorMessage":"failed to install gopls with `go install`. Is `go` installed and in the PATH? Check logs for more information.","messagePattern":"failed to install gopls with `go install`\\. Is `go` installed and in the PATH\\? Check logs for more information\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/languages/src/go.rs","lineNumber":173,"sourceCode":"                return Ok(path);\n            }\n\n            let gobin_dir = container_dir.join(\"gobin\");\n            fs::create_dir_all(&gobin_dir).await?;\n            let install_output = util::command::new_command(go)\n                .env(\"GO111MODULE\", \"on\")\n                .env(\"GOBIN\", &gobin_dir)\n                .args([\"install\", \"golang.org/x/tools/gopls@latest\"])\n                .output()\n                .await?;\n\n            if !install_output.status.success() {\n                log::error!(\n                    \"failed to install gopls via `go install`. stdout: {:?}, stderr: {:?}\",\n                    String::from_utf8_lossy(&install_output.stdout),\n                    String::from_utf8_lossy(&install_output.stderr)\n                );\n                anyhow::bail!(\n                    \"failed to install gopls with `go install`. Is `go` installed and in the PATH? Check logs for more information.\"\n                );\n            }\n\n            let installed_binary_path = gobin_dir.join(BINARY);\n            let version_output = util::command::new_command(&installed_binary_path)\n                .arg(\"version\")\n                .output()\n                .await\n                .context(\"failed to run installed gopls binary\")?;\n            let gopls_version = parse_version_output(&version_output)?;\n            let binary_path = container_dir.join(format!(\"gopls_{gopls_version}_go_{go_version}\"));\n            fs::rename(&installed_binary_path, &binary_path).await?;\n\n            Ok(LanguageServerBinary {\n                path: binary_path.to_path_buf(),\n                arguments: server_binary_arguments(),\n                env: None,","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/languages/src/go.rs#L155-L191","documentation":"The `go install golang.org/x/tools/gopls@latest` subprocess exited with a non-zero status, so gopls could not be built/installed into GOBIN; the failure is logged with stdout/stderr and surfaced as this error.","triggerScenarios":"Thrown at crates/languages/src/go.rs:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify `go` is installed and on PATH, then retry","Run `go install golang.org/x/tools/gopls@latest` manually to see the real error","Check network/proxy settings if module downloads fail","Install gopls via the OS package manager and set the binary path in Zed settings"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}