redhat-developer / intellij-dependency-analytics

IntelliJ Dependency Analytics
Eclipse Public License 2.0
24 stars 19 forks source link

fails with "please make sure go is installed" #116

Open SVilgelm opened 1 year ago

SVilgelm commented 1 year ago

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.

Screenshot 2023-05-19 at 10 00 10 AM

Steps to reproduce:

TomerFi commented 1 year ago

Can you please try running IntelliJ Idea from the terminal?

/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
SVilgelm commented 1 year ago

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.

TomerFi commented 1 year ago

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.

SVilgelm commented 1 year ago

Okay, I did ~/Library/Application\ Support/JetBrains/Toolbox/scripts/goland and the issue is still same.

Screenshot 2023-05-19 at 10 00 10 AM

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:

Screenshot 2023-05-20 at 2 26 47 PM

and here is the Mac's terminal:

Screenshot 2023-05-20 at 2 27 37 PM

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

Screenshot 2023-05-20 at 2 29 04 PM
SVilgelm commented 1 year ago

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

SVilgelm commented 11 months ago

@TomerFi any updates? It's almost 6 months since I created the issue.