Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run my golang main package under atom.io?

Tags:

go

atom-editor

I use atom.io with go-plus package to develop golang. I usually run main package with "Golang: run Package" command, but it has disappeared recently, and I do not know if there is another way to do it apart from that ...

Any help will be nice.

Thanks in advance

like image 391
thamurath Avatar asked Dec 22 '16 11:12

thamurath


People also ask

How do I run a script package in Atom?

You can go settings, select packages and type atom-runner there if your browser can't open this link. To run your code do Alt + R if you're using Windows in Atom .


1 Answers

With additional plugins:

atom-runner: https://atom.io/packages/atom-runner

Once you install it, just hit ALT+R to run the file. Note that this may collide with the go-plus plugin's Rename functionality. You may change any of the key bindings in Atom's settings (change one of them to be unique to your liking). If you don't want to change keybindings, you may use Atom's Command Palette: press CTRL+SHIFT+P, then type "run" or "run file", and it will be the first or second item.

plattformio-ide-terminal: https://atom.io/packages/platformio-ide-terminal

Installing this gives you an internal terminal. Click the plus icon at the bottom, which opens a terminal. You can configure it to open a terminal having the working directly of the current file, so after that all you need is to type go run xx.go. You may also "fast-open" the terminal by pressing ALT+SHIFT+T.

Note: platformio-ide-terminal is a fork of terminal-plus, one which did not work for me (and reportedly for others).

like image 165
icza Avatar answered Nov 11 '22 20:11

icza