williamboman / mason.nvim

Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
Apache License 2.0
7.22k stars 258 forks source link

golang packages unable to install #1684

Closed sahinf closed 2 months ago

sahinf commented 2 months ago
          I ran into this issue too, but my GOPATH is already configured to point to home directory.
❯ go env GOPATH GOMODCACHE
/home/furkan/go
/home/furkan/go/pkg/mod

Output of Mason trying to install gopls, delve:

  Failed
    ✗ gopls
      ▼ Displaying full log
        Installing go package golang.org/x/tools/gopls@v0.15.3…
        go: golang.org/x/tools/gopls@v0.15.3: golang.org/x/tools/gopls@v0.15.3: Get "https://proxy.golang.org/golang.org/x/tools/gopls/@v/v0.15.3.info": dial tcp: lookup proxy.golang.org on [::1]:53: dial udp [::1]:53: connect: network is unreachable
        spawn: go failed with exit code 1 and signal 0. 

    ✗ delve
      ▼ Displaying full log
        Installing go package github.com/go-delve/delve/cmd/dlv@v1.22.1…
        go: github.com/go-delve/delve/cmd/dlv@v1.22.1: github.com/go-delve/delve/cmd/dlv@v1.22.1: Get "https://proxy.golang.org/github.com/go-delve/delve/cmd/dlv/@v/v1.22.1.info": dial tcp: lookup proxy.golang.org on [::1]:53: dial udp [::1]:53: connect: network is unreachable
        spawn: go failed with exit code 1 and signal 0. 

verifying that my network settings to the proxy are not a cause:

❯ curl https://proxy.golang.org/golang.org/x/tools/gopls/@v/v0.15.3.info | jq -r
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   215  100   215    0     0    674      0 --:--:-- --:--:-- --:--:--   673
{
  "Version": "v0.15.3",
  "Time": "2024-04-12T18:54:51Z",
  "Origin": {
    "VCS": "git",
    "URL": "https://go.googlesource.com/tools",
    "Subdir": "gopls",
    "Ref": "refs/tags/gopls/v0.15.3",
    "Hash": "cd70d50baa6daa949efa12e295e10829f3a7bd46"
  }
}

Originally posted by @sahinf in https://github.com/williamboman/mason.nvim/issues/824#issuecomment-2060105181

sahinf commented 2 months ago

happens with gospel too

    ✗ gospel
      ▼ Displaying full log
        Installing go package github.com/kortschak/gospel@v1.14.0…
        go: github.com/kortschak/gospel@v1.14.0: github.com/kortschak/gospel@v1.14.0: Get "https://proxy.golang.org/github.com/kortschak/gospel/@v/v1.14.0.info": dial tcp: lookup proxy.golang.org on [::1]:53: dial udp [::1]:53: connect: network is unreachable
        spawn: go failed with exit code 1 and signal 0.