Open karl-gustav opened 4 years ago
did anyone find a solution for this,even though everything is set properly this error continues to pop up its is quite annoying.
Has anyone found the solution? I have them properly set under go env
and also tried making a json user setting but nothing
{
"env":
{
"GOPATH": "/home/user/go",
}
}
I could only get this to work by going to the Golang Config
package settings and manually setting my PATH
and GOPATH
there.
golang.sublime-settings
{
"PATH": "/Users/username/go/bin",
"GOPATH": "/Users/username/go"
}
https://github.com/golang/sublime-config/blob/master/docs/user.md#global-sublime-text-settings
What's weird is that I did not need to manually set the PATH
, GOPATH
, nor GOROOT
to get SublimeLinter-golint
working. Not exactly sure why that is the case.
from the author:
I use golangconfig to run the go binaries. It supports overriding the PATH it uses, and has examples in the user documentation. As its intent is to normalize configuration across Golang packages for Sublime, I’d rather not deviate from its established way of doing things. Could you take a look at the docs and see if that gets things working?
https://github.com/noonat/sublime-gofmt/issues/5#issuecomment-335198104
I got the same problem when use sublime text 4 and install package https://packagecontrol.io/packages/Gofmt
on MacOS
Use command which go
in your terminal to get the GOPATH
.
Set them in golang.sublime-settings
{
"PATH": "/usr/local/bin/go/bin",
"GOPATH": "/usr/local/bin/go"
}
It's done.
I can confirm that the same issue exists on Ubuntu 22.04 as well, and the fix works there too. By default, the golang.sublime-settings
file will be located under ~/.config/sublime-text/Packages/User
I got the same problem when use sublime text 4 and install package
https://packagecontrol.io/packages/Gofmt
on MacOSUse command
which go
in your terminal to get theGOPATH
. Set them ingolang.sublime-settings
{ "PATH": "/usr/local/bin/go/bin", "GOPATH": "/usr/local/bin/go" }
It's done.
Duuuuude, thank you a lot <3 you save my life
Got this error after installing this plugin with package control:
The ENV variable is set if I open up a terminal, but I'm guessing this is looking some where else for that variable...