工欲善其事,必先利其器
golandVSCode
1. GolandJetBrains
JetBrains

1.首先打开File->Setting或者Ctrl+Alt+S,设置goroot和gopath,默认会获取环境变量配置


2.如果我们需要使用go modules功能,需要进行开启设置;

3.最好我们编写helloworld运行
新建项目study1,选择目录

新建go文件

编写hello world

最后点击左侧启动运行,或者按Ctrl+Shift+F10运行程序

最终我们看到hello world运行成功!
下面列举了一些 Goland 中经常使用到的快捷键。
文件操作
代码格式化

查找和定位

编辑代码

编辑器

3. VSCode
VSCode 全称 Visual Studio Code,是微软出的一款轻量级代码编辑器,免费、开源而且功能强大。它支持几乎所有主流的程序语言的语法高亮、智能代码补全、自定义热键、括号匹配、代码片段、代码对比 Diff、GIT 等特性,支持插件扩展,并针对网页开发和云端应用开发做了优化。
VSCode的官网:https://code.visualstudio.com/

在VSCode中安装Go插件
进入Extensions后直接搜索go,即可安装

在编辑代码时会提示安装一些插件,选择安装即可;
如果没有提示也可以自行安装,大致如下
4. VSCode 常用快捷键




导航









github:https://github.com/goflyfox/gostudy
gitee:https://gitee.com/goflyfox/gostudy
腾讯课堂教程地址:https://ke.qq.com/course/2585401?taid=9426843331949369&tuin=13b4f9bd
公众号搜索:GoWeb学习之路