I'm having a Raspberry pi4 4GB model, with the raspbian (TWISTER OS) installed. I have installed GOlang from google using the pip install golang command. But I am having problem with installing compilers. previously I tried to install 'Eclipse' but it didn't start. I need some help finding out the right compiler for Golang and how to install it. I'm just a beginner at programming and am interested to learn the programming language. Thanks.
- 3
- 3
2 Answers
Go is not obscure, you can install it from the distro repositories:
apt search golang
Turns up hundreds of things. To narrow it down a bit:
apt search golang | grep -iB 2 compiler
The command line compiler is in the golang package; sudo apt install golang. The CLI compiler is just called go. There should be oodles and oodles of documentation for that online. When you are searching in this context, search linux golang not raspberry pi 4 2BG golang -- the brand of hardware is not relevant; you might as well search rpi red case golang or my home address golang. In fact, once it is installed you can just search golang some topic and leave out the OS and brand of hardware.
What about an IDE...
(Note I'm actually not a go user, but one may come along eventually.)
A full fledged IDE on a 4 GB machine with a relatively very slow processor is unlikely to be fun. However, there are various code editors -- which at a minimum will have syntax highlighting, and some have IDE like features such as completion and debugger integration -- should be okay. You may then have to compile and run from a command line, but this is not a difficult thing and you will quickly get used to it.
I believe sublime, which is fairly popular, has a go plugin, so you might start there. For myself when an IDE is not available I am a big gvim fan but I would not recommend it to new users.
Another potential option is to work remotely, which most IDEs should do. This means you work on another computer but compile and run stuff on a networked pi.
- 60,325
- 17
- 117
- 234
If you need an IDE on RPi I'd always see if Emacs, which is installed as sudo apt-get install emacs, supports a language. And lo and behold a google for emacs AND gloang yields an Emacs wiki page for Gowhich also has a nice link to Writing Go In Emacs.
Four Gigabyte might seem not much, and a RPi may seems slow but given that the GUI hasn't been prettified like Mac OS or Windoze it it surprisingly perky. Emacs puts little resource load on RPi, unlike when I first used in the 1980's when it was Eight Megabytes And Constantly Swapping. So you should find it perfectly ok to use.
As for installing packages if you have X Windows open use synaptic from the menu "Preferences -> Add/Remove Software" unless you're comfortable with the command line.
- 774
- 4
- 16