Goland can't get GOPATH from system environmental variable on Linux

When I started Goland through the .desktop file, it couldn't get GOPATH from the system environment variable, but it was normal when I started it in the terminal.

2 comments
Comment actions Permalink

Hi,

I believe it's an expected behavior. Likely you've set GOPATH for bash (or any other shell) but when you run an application, Ubuntu doesn't run it via shell. You can use profile or environment file to propagate your variable into GUI applications. Also, GoLand is able to read your login bash environment on the start, so another option is to set GOPATH in .bash_login instead of .bashrc.

E.g. see https://askubuntu.com/questions/866161/setting-path-variable-in-etc-environment-vs-profile

0

Please sign in to leave a comment.