0

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.

2
  • 2
    Do you mean IDE? Eclipse isn't a compiler. If you are just starting out you can just use a text editor and the command line to edit and compile your code. I would even recommend this so you understand what is happening to your code. Later you can use the more advanced features of an IDE. Also, I don't believe Twister OS is Raspbian, though it may be Raspbian based. Jun 8, 2020 at 13:23
  • Well to be honest, when I use this OS to sign into my gmail, google asks me to confirm the authenticity of the sign in and identifies the raspberry pi OS to be Chrome OS. I am familiar with Python and just want to explore other language which is the reason for the problem I'm facing. Starting from square one. Jun 8, 2020 at 15:31

2 Answers 2

0

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.

2
  • I wouldn't call Emacs beginner friendly. Jun 8, 2020 at 19:00
  • Just goes to show old dogs can teach new pups old tricks :-)
    – Nick
    Jun 8, 2020 at 19:04
1

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.

2
  • Is there any compiler or IDE like thonny to compile other than the command line? I'm just tensed that since I'm a beginner I might fry up my Pi if I happen to type out some messed up code. Jun 8, 2020 at 15:34
  • If you want to avoid major hazards, use an unprivileged account when working on code (eg., the pi user sans sudo). An IDE would make zero difference to that risk, but of course they are nicer to work with. I've edited in some stuff above about that.
    – goldilocks
    Jun 8, 2020 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.