有没有像 ptpython 那样的用于 golang 的解释器和自动补全工具?

huangapple go评论67阅读模式
英文:

Is there an interpreter and auto-complete tool for golang like ptpython?

问题

对于Golang,你想通过在shell中练习Golang代码来学习,是否有类似于ptpython解释器自动补全工具?

英文:

I'm new to Golang, I want to learn by practicing Golang codes in my shell, is there an interpreter and auto-complete tool like ptpython for golang?

答案1

得分: 1

如果你正在使用vim:

请查看以下内容:

vim-gogocodegotools

vim-go文档

英文:

If you are using vim:

Please check this out :

vim-go, gocode and gotools

vim-go docs

答案2

得分: 1

Go语言没有解释器(它是一种编译语言)或REPL,但有一个用于尝试代码的Go Playground(https://play.golang.org/)。

至于自动补全,根据你使用的编辑器,有各种各样的工具可供选择;我使用的是emacs:

M-x package install go-autocomplete:

(ac-config-default)
(require 'auto-complete-config)
(require 'go-autocomplete)

如果你想要一个同时具有REPL和自动补全功能的工具,我可以向你推荐一个用于Go Playground的扩展(如果你使用的是Chrome):
Better Go Playground

它提供以下功能:

  • Golang语法高亮显示
  • 使用Ace编辑器替代内置编辑器
  • 运行代码时标记具有语法错误的行
  • 自动补全+代码片段
  • 自动保存到本地存储
  • 暗色/亮色主题切换

这些功能都在一个类似REPL的环境中(但不能进行网络相关的操作)。

英文:

There isn't an interpreter (it's a compiled language) or REPL for Go, but there is the go playground https://play.golang.org/ for trying out code.

And for autocomplete, there is a variety of tools out there depending on your editor; I use emacs:

> M-x package install go-autocomplete:

(ac-config-default)
(require 'auto-complete-config)
(require 'go-autocomplete)

If you want a REPL and/with autocomplete, the best I can point you towards is an extension for the go play ground (if you using chrome):
Better Go Playground

It advertises:

> - Golang syntax highlighting
> - Replaces the built in with the Ace editor
> - Mark lines with syntax errors when running your code
> - Auto-completion + Snippets
> - Auto-save to local storage
> - Dark/Light theme toggle

all in a REPL like environment (you can't do networking stuff though)

huangapple
  • 本文由 发表于 2016年12月16日 02:34:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/41171070.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定