


LSP-gopls in Sublime Text creates go directory in $HOME instead of custom location
Feb 13, 2024 pm 12:12 PMphp editor Xinyi discovered that some users recently reported that the LSP-gopls plug-in in Sublime Text would create go folders in the $HOME directory during the installation process, instead of according to the user Custom location. This issue may cause some inconvenience to users, so we provide a solution here.
Question content
I use Sublime Text and the LSP-gopls plugin for Go development, and I have a custom GOPATH
setting: $HOME/Code/ go
instead of $HOME/go
.
However, every time I run Sublime Text, the directory go/pkg/mod/...
is created inside the $HOME
directory. Normally, LSP-gopls should store these files in the directory specified by $GOPATH
, but it uses the default directory.
How to solve?
I'm sure it's LSP-gopls because when I disable it, delete the directory in $HOME
and restart Sublime Text, this behavior goes away. I have export GOPATH=$HOME/Code/go
in .zshrc
. In the plugin settings, set the custom path to gopls
to "command" : ["/Users/user/Code/go/bin/gopls"]
.
Workaround
Turns out I needed to set $GOMODCACHE
in the LSP-golsp settings.
"settings": { "gopls.env": {"GOMODCACHE":"/Users/user/Code/go/pkg/mod"} }
The above is the detailed content of LSP-gopls in Sublime Text creates go directory in $HOME instead of custom location. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to hide photo album on Redmi Note13RPro?

How to adjust the font size on Redmi Note13RPro?

How to set dynamic wallpaper on Redmi Note13RPro?

How to connect Redmi Note13RPro to the computer?

How to extract text from pictures on Redmi Note13RPro?

How to turn off the camera sound on Redmi Note13RPro?

A complete guide to all levels of 'Whole Life'

How to adjust the font size on Redmi Note13RPro?
