intellij-dependency-analytics icon indicating copy to clipboard operation
intellij-dependency-analytics copied to clipboard

fails with "please make sure go is installed"

Open SVilgelm opened this issue 2 years ago • 6 comments

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:

  • 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

SVilgelm avatar May 19 '23 17:05 SVilgelm

Can you please try running IntelliJ Idea from the terminal?

/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea

TomerFi avatar May 19 '23 19:05 TomerFi

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.

SVilgelm avatar May 19 '23 19:05 SVilgelm

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.

TomerFi avatar May 20 '23 09:05 TomerFi

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 avatar May 20 '23 21:05 SVilgelm

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 avatar May 20 '23 21:05 SVilgelm

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

SVilgelm avatar Oct 10 '23 22:10 SVilgelm