ray-x / go.nvim

G'day Nvimer, Joyful Gopher: Discover the Feature-Rich Go Plugin for Neovim
MIT License
1.91k stars 119 forks source link

`:checkhealth` warns that `GOBIN` and `GOROOT` is not set even if its set to corret value #403

Closed qwexvf closed 7 months ago

qwexvf commented 7 months ago

checkhealth warns that GOROOT And GOBIN is not set even though i have those two env set to correct value

Go Plugin Check ~
- OK lspconfig: plugin is installed
- OK nvim-treesitter: plugin is installed
- WARNING guihua: not installed/loaded
- WARNING nvim-dap-virtual-text: not installed/loaded
- WARNING telescope: not installed/loaded
- OK nvim-treesitter-go is installed
- WARNING nvim-dap-ui: not installed/loaded
- WARNING nvim-dap: not installed/loaded
- WARNING Not all plugin installed
- GOROOT is not set
- GOBIN is not set
- Not all environment variables set
- WARNING GOBIN is not in PATH

my env

❯ go env
GOARCH="arm64"
GOBIN="/Users/qwexvf/.local/share/rtx/installs/go/1.20.5/go/bin"
...
GOMODCACHE="/Users/qwexvf/.local/share/rtx/installs/go/1.20.5/packages/pkg/mod"
...
GOOS="darwin"
GOPATH="/Users/qwexvf/.local/share/rtx/installs/go/1.20.5/packages"
GOROOT="/Users/qwexvf/.local/share/rtx/installs/go/1.20.5/go"
...
GOVERSION="go1.20.5"

```bash
❯ echo $PATH | grep "$GOPATH/bin" 
/Users/qwexvf/.local/share/rtx/installs/go/1.20.5/go/bin:/Users/qwexvf/.local/share/rtx/installs/go/1.20.5/packages/bin
qwexvf commented 7 months ago

I'm thinking the regexp part is wrong on some distros?

i tested this line but it wont match any of the strings in my go env results. https://github.com/ray-x/go.nvim/blob/ad5db6a907160e0d78671acf93d0ebfccd2fae30/lua/go/health.lua#L144

ill see if i can fix this( also need to confirm if its not working on specific distros)

ray-x commented 7 months ago

Based on your output, it is the double quote in the output GOOS="darwin" Pushed a fix

qwexvf commented 7 months ago

@ray-x Hey thanks for the quick fix! can confirm that it works now

- OK GOROOT is set
- OK GOBIN is set
- OK All environment variables set
- OK GOBIN is in PATH