I'm try to setup my golang IDE on doom-emacs.

I've go installed

    $ go version
    go version go1.14.3 darwin/amd64

gopath is set -

    $ echo $GOPATH

$PATH is set as -

    $ echo $PATH

As you see $GOPATH/bin is in $PATH.

gopls is installed as well -

    $ which gopls

    $ gopls version
    golang.org/x/tools/gopls 0.4.1
        golang.org/x/tools/gopls@v0.4.1 h1:0e3BPxGV4B3cd0zdMuccwW72SgmHp92lAjOyxX/ScAw=

But when I open a gocode in file I get error LSP :: No LSP server for go-mode (check *lsp-log*)

golsp error

I check this [comment][2go mod init /root/TestApp] in github If I do SPC h d d I didn't get anything

Below is the M-x getenv RET PATH RET result -

PATH doom emacs

Note - My Os is macos sierra 10.12.6 version

I tested this in fedora as well and same issue is happening.

    $ lsb_release -a
    LSB Version:    :core-4.1-amd64:core-4.1-noarch
    Distributor ID: Fedora
    Description:    Fedora release 31 (Thirty One)
    Release:        31
    Codename:       ThirtyOne

Any idea how can I fix this issue?

  • Is $GOPATH/bin in your path from within emacs? M-x getenv RET PATH RET? – psanford May 27 '20 at 2:51
  • @psanford - $GOPATH/bin is not in the path within emacs. Thanks for your hint. How can I add there as well? – Rajkumar Natarajan May 27 '20 at 4:18
  • Are you sure your Os is macOS? That screenshot appears to be fedora. – Dan Robertson May 27 '20 at 13:37
  • What did you see when you checked *lsp-log*? (Ie changed to that buffer and had a look) – Dan Robertson May 27 '20 at 13:40
  • If you start emacs from the terminal it will inherit the PATH you set in the terminal. Or you can set the path directly in emacs via (setenv "PATH" "/path/a:path/b/:path/c") – psanford May 27 '20 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.