Windows 安装vs code
最后更新于:2022-04-02 04:42:32
vs code
https://blog.csdn.net/u013295518/article/details/78766086
git
https://www.cnblogs.com/wj-1314/p/7993819.html
编辑器
https://baijiahao.baidu.com/s?id=1614302321218595908&wfr=spider&for=pc
Visual Studio Code,简称VS Code,它是目前使用人数最多的编辑器。尽管它由微软发布于2015年,与其他热门编辑器相比显得有些年轻,但它在过去几年中一直在不停的更新,它在最新的Stack Overflow调查中被选为Web开发人员中最受欢迎的文本编辑器。
VS Code不仅仅是一个基本的代码编辑器。有人说它更像是IDE而不是代码编辑器,因为它提供了许多通常只在IDE中才有的功能。主要功能包括内置调试工具,智能代码提示,集成终端以及对简易的Git操作(微软刚收购了GitHub)。作为初学者,您可以利用这些功能大大提高编程效率。
在 VS Code 中找到的每个功能都完成一项出色的工作,构建了一些简单的功能集,包括语法高亮、智能补全、集成 git 和编辑器内置调试工具等,将使你开发更高效。
# 安装vscode
下载地址:https://code.visualstudio.com/
选择windows版本下载,vscode有新版本时候会自动更新,重启即可更新。

图:1 vs code下载图

图:2 vs code下载过程图
下载完成双击打开,出现下图提示点击运行。

图:3 打开提示运行图
点击运行进入下图,安装向导页面

图:4 安装向导图

图:5 许可协议图

图:6 选择目标位置图

图:7 选择开始菜单文件夹图

图:8 选择其他任务图

图:9 安装准备就绪图

图:10 正在安装图

图:11 安装完成图
#安装go插件
启动vscode选择插件->搜`go`选择`Go for Visual Studio Code`插件点击安装即可。如图:

图:12 选择安装插件图

图:13插件安装完成图
#windows 安装Git
若你的Windows 系统已经装有git,跳过该安装。
Git是当今最流行的版本控制软件,它包含了许多高级工具,这里小编就讲一下Git的安装。
下载地址:http://msysgit.github.com/
进入管网,根据官网提示点击下载相应的版本。

图:1 git官网下载图

图:2 git下载过程图
下载完成,双击打开进行git的安装。

图: 3 确认安装图
首先如下图:(点击next)

第二步:文件位置存储,可根据自己盘的情况安装

第三步:安装配置文件,自己需要的都选上,下一步

第四步:不创建启动文件夹,下一步:

第五步:选择默认的编辑器,我们直接用推荐的就行,下一步

第六步:勾上第二项,这样就可以在cmd中操作,下一步

第七步:使用默认设置就行,下一步:

第八步:配置行结束标记,保持默认“Checkout”

第九步:在终端模拟器选择页面,默认即可,配置后Git

第十步:最后配置Git额外选择默认即可,然后安装。

第十一步:安装过程

第十二步:安装完成

第十二步:使用Git,桌面快捷方式界面如下,打开就可以使用

上述过程便是在windows环境下安装git的大致过程,对于不同的git版本安装过程可能会略有差异,但整体步骤均相同。
在调试之前需要先执行下面的命令,安装go程序调试包。
go get github.com/derekparker/delve/cmd/dlv
进行安装

安装完成,打开vs code 。点击 File 选择 Open Floder 打开GOPATH目录。

进入src目录,新建project目录,新建main.go文件,输入内容如下。
~~~
package main
func main(){
print("hello world");
}
~~~
点击 View 选择 Debug console 打开Debug console 窗口,如下图。

点击 Debug 选择 Start Debugging 打开开始调试,如下图。

查看运行结果。

';