sublimelsp / LSP-gopls

Golang support for Sublime's LSP plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: go binary not found in $PATH

cig0 opened this issue · comments

Hi,

I'm trying to understand why LSP-gopls is unable to find the Go binaries since both go and gopls are both in my shell's PATH.

In the screenshot below, I can successfully run both programs from a Terminus terminal:

image

I tried with the command setting using an absolute path but I've got the same result

Just another screenshot showing the PATH being correctly set (within Terminus):

image

I tried with the command setting using an absolute path but I've got the same result

  • Can you attach your lsp configuration?
  • Do you use LSP-gopls or did you manually add the configuration for gopls in the LSP settings?

Hi guys, thanks for your quick response 🚀

Before going ahead with my replies, these are my system specs:

OS: Fedora 36 Kinoite (Silverblue w/ KDE)
Shell: zsh 5.8.1 (x86_64-redhat-linux-gnu)
Terminal app: Konsole 22.04.1 -- every terminal is instantiated as a login interactive terminal, /usr/bin/zsh -i -l
Sublime Text Build 4126, installed as an RPM package from the official repository:

[sublime-text]
name=Sublime Text - x86_64 - Stable
baseurl=https://download.sublimetext.com/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/sublimehq-rpm-pub.gpg

@rchl that did the trick... kind of. Setting the path in the ~/.profile file didn´t work, I also tried with ~/.zprofile with the same result. What did work though was setting the path at a system-wide level, by sourcing the file from /etc/profile.d/.
While I don't see that any issue could arise from setting the path there, I'm not sure this is the right way to go; I mean, the documentation for both macOS and GNU+Linux points out to the user home directory, not the system profile's directory.

@predragnikolic

  1. It is as clean as it can be:
    image
    (I already tried uncommenting that command line which points to the right path and filename, but it didn't work -- although it does work if I run it on a terminal)

  2. I installed LSP-gopls from Package Control
    image

Setting the path in the ~/.profile file didn´t work, I also tried with ~/.zprofile with the same result.

Did you tried to log out and log back in Linux after applying the changes to ~/.profile?

Setting the path in the ~/.profile file didn´t work, I also tried with ~/.zprofile with the same result.

Did you tried to log out and log back in Linux after applying the changes to ~/.profile?

OMG, I feel so st00pid 🤦‍♂️

/me slowly step back and get out of the room hoping nobody sees him leaving...

(Thanks again for your time @predragnikolic, @rchl, and for all your work here!)