fails with "please make sure go is installed"
Hi,
I'm using Goland 2023.1.1 and go 1.20.4. The issue is that the Analytics plugin is unable to find the installed go.
I do not install go on system/user level, I use Goland to download and install the needed version of go. If I open a Mac terminal and type which go, I will get back go not found. But if I do same in the Goland's terminal then I get /Users/<user>/go/go1.20.4/bin/go
Here is the screen shot of the full error message.
Steps to reproduce:
- Install Goland on clean system
- Open a go project
- Go to Settings -> Go -> GOROOT
- Click on
+-> Download - Select the any version of Go and install
- Go to Settings -> Plugins
- Install Dependency Analitycs
- Open go.mod and run Dependency Analytics Report
Can you please try running IntelliJ Idea from the terminal?
/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
sure, I did open ~/Applications/JetBrains\ Toolbox/GoLand.app, but the issue is still same.
If I do env | grep GO in the Mac's terminal, then I got nothing,
but if I do env | grep GO in the Goland's terminal, then I see
GOPATH=/Users/<user>/go
GOROOT=/Users/<user>/go/go1.20.4
GO111MODULE=on
As I said, I install go using Goland, so I can have the different version of go in different projects.
You need to run Goland using a CLI Launcher and not as a Gui App. Follow this doc to generate the launcher and use it to run Goland.
The issue you're describing in a "mac thing". Basically, Gui Apps use a different set of environment variables than Terminal Apps. See here.
Okay, I did ~/Library/Application\ Support/JetBrains/Toolbox/scripts/goland
and the issue is still same.
Could you try to follow the step I put in the message? Looks like you don't read my messages.
The issue is that there is no Go env variables in the default terminal. I install go using goland and it does not automatically adds the go env variables to .zshrc and the go binary is available only inside the Goland's terminal:
and here is the Mac's terminal:
Just install the Goland in clean systems, without Go at all, or delete go: brew uninstall go
and then install Go in the Goland: Settings -> Go -> GOROOT -> + -> Download
and I don't put the path to ~/.go/bin in .zshrc for a reason, it allows me to use different version of the go in different projects and prevents some weird bugs, when I expect go1.16 but there is a path to go1.20 in the PATH variable
@TomerFi any updates? It's almost 6 months since I created the issue.