{"record":{"id":"960f6912653aa129","repo":"oraios/serena","slug":"go-is-not-installed-please-install-go-from-https","errorCode":null,"errorMessage":"Go is not installed. Please install Go from https://golang.org/doc/install and make sure it is added to your PATH.","messagePattern":"Go is not installed\\. Please install Go from https://golang\\.org/doc/install and make sure it is added to your PATH\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/gopls.py","lineNumber":91,"sourceCode":"    @staticmethod\n    def _get_gopls_version() -> str | None:\n        \"\"\"Get the installed gopls version or None if not found.\"\"\"\n        try:\n            result = subprocess_run([\"gopls\", \"version\"], capture_output=True, text=True, check=False)\n            if result.returncode == 0:\n                return result.stdout.strip()\n        except FileNotFoundError:\n            return None\n        return None\n\n    @staticmethod\n    def _setup_runtime_dependency() -> bool:\n        \"\"\"\n        Check if required Go runtime dependencies are available.\n        Raises RuntimeError with helpful message if dependencies are missing.\n        \"\"\"\n        go_version = Gopls._get_go_version()\n        if not go_version:\n            raise RuntimeError(\n                \"Go is not installed. Please install Go from https://golang.org/doc/install and make sure it is added to your PATH.\"\n            )\n\n        gopls_version = Gopls._get_gopls_version()\n        if not gopls_version:\n            raise RuntimeError(\n                \"Found a Go version but gopls is not installed.\\n\"\n                \"Please install gopls as described in https://pkg.go.dev/golang.org/x/tools/gopls#section-readme\\n\\n\"\n                \"After installation, make sure it is added to your PATH (it might be installed in a different location than Go).\"\n            )\n\n        return True\n\n    def __init__(self, config: LanguageServerConfig, repository_root_path: str, solidlsp_settings: SolidLSPSettings):\n        self._setup_runtime_dependency()\n\n        super().__init__(config, repository_root_path, ProcessLaunchInfo(cmd=\"gopls\", cwd=repository_root_path), \"go\", solidlsp_settings)","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/gopls.py#L73-L109","documentation":"RuntimeError raised during Gopls.__init__ (via _setup_runtime_dependency) when the Go toolchain itself cannot be found. _get_go_version() (which shells out to `go version`) returned nothing, so gopls management cannot proceed. This is a hard prerequisite check before attempting any gopls operations.","triggerScenarios":"Constructing the Gopls language server when `go version` fails or the `go` binary is absent from PATH.","commonSituations":"Go not installed on the machine/CI image; go installed via a version manager not active for the running process; PATH stripped in systemd/cron/IDE-spawned subprocesses.","solutions":["Install Go from https://golang.org/doc/install and verify with `go version`","Ensure the `go` binary directory (e.g. /usr/local/go/bin) is on PATH for the process running the library","If using a version manager (gvm, asdf), activate the Go version in the target environment","Point ls_path/go binary configuration at the absolute go binary path"],"exampleFix":"// before\nwhich go  # not found\n// after\n# Linux example\nsudo rm -rf /usr/local/go && curl -LO https://go.dev/dl/go1.22.0.linux-amd64.tar.gz\nsudo tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz\nexport PATH=$PATH:/usr/local/go/bin\ngo version","handlingStrategy":"validation","validationCode":"import shutil, subprocess\ndef ensure_go_toolchain():\n    if shutil.which('go') is None:\n        raise FileNotFoundError('Go not installed or not on PATH')\n    subprocess.run(['go', 'version'], check=True, capture_output=True)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `go version` in environment bootstrap before running the library","Include Go in your base Docker/CI image","Ensure /usr/local/go/bin (or equivalent) is on PATH for daemonized processes","Document the Go prerequisite for your tooling"],"tags":["go","golang","path","missing-binary","language-server"],"backgroundTag":"missing-executable-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}