Answer the question
In order to leave comments, you need to log in
Goland does not see some folders in linux (including usr/local). How to specify goroot?
I studied the frontend for more than half a year and did not like it, I decided to try the backend and chose Golang. A familiar backender recommended getting acquainted with linux for the future.
1) I'm a beginner
2) I'm going to use the Goland IDE
3) All this on Linux Mint Cinnamon 20.1
According to the instructions of some person from YouTube, I installed go in the usr / local folder, and when I tried to specify goroot in goland, I realized that goland does not see to the usr folder local.
According to the instructions of this sir, I added two lines to the .profile file:
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
What did I do this way?
I tried to remove go from local, but it says that it is impossible. Even through sudo.
My questions:
1) How to remove go from the local folder?
2) How to properly install golang on linux mint?
3) How to set up goland for a simple project? There are a lot of possible settings and everything is not obvious.
Answer the question
In order to leave comments, you need to log in
Thank you all, I solved the problem myself.
And then the solution itself:
1. I removed go completely from all the usr/lib and usr/local folders using the root mode of the file manager.
2. I downloaded the archive with go language files from the official download page , after which I unpacked the archive not into the usr/local/ folder , as the instructions say, but into home/catofood/ (Where catofood is the username) and renamed the go folder to goroot no more confusion. It turned out that the go language files are stored in the following path: home/catofood/ goroot .
3. I went to the console and did the following:
1) I wrote "nano ~ / .profile"
2) In the interface that opened, I scrolled down to the stop
3) (Who has not edited the .profile file before - skip this item) deleted the line
"export PATH= $PATH:/usr/local/go/bin"
4) Added the line export PATH=$PATH:/home/catofood/ goroot/bin (As I understand it, this line links the "go" command in the console to the go files themselves)
5) Pressed ctrl + x, then Y, then enter (Exit, save changes, leave name alone)
6) Go to goland and set the path to "home/catofood/ goroot ", where catofood is the username. Goland SAW a folder with go files.
7) Everything works!
I'm sorry about the water, but I managed and I'm glad about it!
First of all, I recommend referring to the official instructions, in particular Go: https://golang.org/doc/install
You did everything right by installing Go in usr/local/go. Accordingly, the first two questions are eliminated. It seems to me that the problem here is different. You write that you tried to specify GOROOT, but GoLand does not see the usr/local folder, which is strange.
Can I have a little more details? What happens when you try to find a folder in the tree? Have you tried clicking Show path and entering the path manually? What version of GoLand are you using?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question