在Windows/Ubuntu上使用Visual Studio Code作为Go语言编辑器操作步骤

下面以在Windows10上操作为例,在Ubuntu上操作步骤与windows一致:

1. 从 https://code.visualstudio.com/  下载windows上的最新发布版本1.21.1,即VSCodeSetup-x64-1.21.1.exe;

2. 以管理员身份运行VSCodeSetup-x64-1.21.1.exe;

3. 打开Visual Studio Code:依次点击:查看 --> 扩展,在编辑框中输入Go,点击安装,重新加载,如下图:

在Windows/Ubuntu上使用Visual Studio Code作为Go语言编辑器操作步骤

4. 新建一个hello.go文件,内容如下,执行时,会提示”The “gopkgs”command is not available. Use “go get -v github.com/uudashr/gopkgs/cmd/gopkgs”to install”,点击”InstallAll”按钮安装:

在Windows/Ubuntu上使用Visual Studio Code作为Go语言编辑器操作步骤

5.      依次点击:调试 --> 非调试启动,执行结果如下:

在Windows/Ubuntu上使用Visual Studio Code作为Go语言编辑器操作步骤

GitHub: https://github.com/fengbingchun/Go_Test