zed-industries/zed · error · anyhow::Error

Could not install the Go language server `gopls`, because `g

Error message

Could not install the Go language server `gopls`, because `go` was not found.

What it means

fetch_latest_server_version detects that the `go` toolchain is absent (delegate.which fails). Installing gopls requires `go install`, so a one-time notification is shown instead of attempting installation that would surely fail.

Source

Thrown at crates/languages/src/go.rs:90

        delegate: &Arc<dyn LspAdapterDelegate>,
        _: bool,
        cx: &mut AsyncApp,
    ) -> Result<Option<String>> {
        static DID_SHOW_NOTIFICATION: AtomicBool = AtomicBool::new(false);

        const NOTIFICATION_MESSAGE: &str =
            "Could not install the Go language server `gopls`, because `go` was not found.";

        if delegate.which("go".as_ref()).await.is_none() {
            if DID_SHOW_NOTIFICATION
                .compare_exchange(false, true, SeqCst, SeqCst)
                .is_ok()
            {
                cx.update(|cx| {
                    delegate.show_notification(NOTIFICATION_MESSAGE, cx);
                });
            }
            anyhow::bail!(
                "Could not install the Go language server `gopls`, because `go` was not found."
            );
        }

        let release =
            latest_github_release("golang/tools", false, false, delegate.http_client()).await?;
        let version: Option<String> = release.tag_name.strip_prefix("gopls/v").map(str::to_string);
        if version.is_none() {
            log::warn!(
                "couldn't infer gopls version from GitHub release tag name '{}'",
                release.tag_name
            );
        }
        Ok(version)
    }

    async fn check_if_user_installed(
        &self,

View on GitHub (pinned to f4178619ac)

Solutions

  1. Install Go (from go.dev or the system package manager) and ensure `go` is on PATH
  2. Restart Zed after installing Go so the PATH is picked up
  3. Install gopls manually (`go install golang.org/x/tools/gopls@latest`) and configure its binary path in settings
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/languages/src/go.rs:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/25e0c7dc29334628. Report an issue: GitHub.