如何直接从 vim 运行 go lang 代码?

4 vim go

如何go lang code直接运行vim editor

例如当前编辑的文件是array.go. 我应该使用什么样的命令在 vim 中运行这段代码?

小智 6

好的,经过一些尝试后,这是有效的:!go run %