Visual Studio Code-GO tasks 设置 (实现在vsc下直接编译输出的功能)
- 2019 年 11 月 20 日
- 笔记
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/wangtongxue123456/article/details/52072661
Visual Studio Code -GO 使用过程中发现,如果要编译输出某个文件需要去cmd窗口才行,感觉特别麻烦网上一直没找到解决办法,这几天查看Visual Studio Code文档发现它提供 tasks 功能可以实现
需要了解Visual Studio Code所有功能配置是通过json文件配置的
tasks 工作原理是Visual Studio Code 自动执行你之前配置好的功能。
配置方法 :
第一次使用 打开vsc界面按 快捷键 Ctrl+Shift+B 会弹出

点击配置任务运行程序

点击Others

出现这个就是我们的配置文件,我们只要把我们的go语言的编译命令配上就行了 我的配置文件 tasks.json 更详细配置:http://code.visualstudio.com/docs/editor/tasks { // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format “version”: “0.1.0”, “command”: “go”, “isShellCommand”: true, “args”: [“run”,”${file}”], “showOutput”: “always” }
配置好后 Ctrl+Shift+B 就可以自动编译输出 测试:
