英文:
How can I run my golang main package under atom.io?
问题
我使用atom.io和go-plus包来开发golang。我通常使用"Golang: run Package"命令来运行主包,但最近它消失了,我不知道是否有其他方法可以运行它...
任何帮助都将不胜感激。
提前感谢。
英文:
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
答案1
得分: 10
使用额外的插件:
atom-runner: https://atom.io/packages/atom-runner
安装后,只需按下<kbd>ALT+R</kbd>即可运行文件。请注意,这可能会与go-plus插件的重命名功能冲突。您可以在Atom的设置中更改任何键绑定(将其中一个更改为您喜欢的唯一键绑定)。如果您不想更改键绑定,可以使用Atom的命令面板:按下<kbd>CTRL+SHIFT+P</kbd>,然后键入“run”或“run file”,它将是第一或第二个项目。
plattformio-ide-terminal: https://atom.io/packages/platformio-ide-terminal
安装此插件将为您提供一个内部终端。单击底部的加号图标,打开一个终端。您可以配置它以打开一个具有当前文件的工作目录的终端,之后您只需键入go run xx.go
即可。您还可以通过按下<kbd>ALT+SHIFT+T</kbd>来“快速打开”终端。
注意:platformio-ide-terminal是terminal-plus的一个分支,据报道,terminal-plus对我(以及其他人)无效。
英文:
With additional plugins:
atom-runner: https://atom.io/packages/atom-runner
Once you install it, just hit <kbd>ALT+R</kbd> 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 <kbd>CTRL+SHIFT+P</kbd>, 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 <kbd>ALT+SHIFT+T</kbd>.
Note: platformio-ide-terminal is a fork of terminal-plus, one which did not work for me (and reportedly for others).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论