VSCode 配置 Go 开发环境

  • 原创
  • Madman
  • /
  • /
  • 0
  • 10191 次阅读

Golang.jpg

Synopsis: 开始学习使用 Go 语言开发存储管理系统,IDE 使用微软的 Visual Studio Code,安装 vscode-go 扩展,配置 Go 开发环境

1. 安装 Go

Go基础|第1章:Get started with Go

2. 安装 VSCode

Visual Studio Code 下载最新版安装即可

打开 VSCode,按 Ctrl + Shit + X 快捷键,打开扩展商店,可选择安装如下插件:

  1. 中文: Chinese (Simplified) Language Pack for Visual Studio Code
  2. 图标: vscode-icons
  3. 主题: One Dark Pro
  4. 火焰特效: power mode

然后按 Ctrl + Shit + P 快捷键,打开 命令面板,输入 Preferences: Open User Settings,修改用户个人配置 settings.json

{
  /**
   * 应用程序
   */
  // 禁用要发送给 Microsoft 的使用情况数据和错误。
  "telemetry.enableTelemetry": false,
  // 禁用要发送给 Microsoft 的故障报表,此选项需重启才可生效
  "telemetry.enableCrashReporter": false,
  // Enable usage data and errors to be sent to Red Hat servers.
  "redhat.telemetry.enabled": false,

  /**
   * 窗口
   */
  // 调整窗口的缩放级别。快捷键:Ctrl + 放大;Ctrl - 缩小
  "window.zoomLevel": 0.5,

  /**
   * 文本编辑器
   */
  // 默认换行符 LF
  "files.eol": "\n",
  // 控制自动保存未保存的编辑器。onFocusChange: 当编辑器失去焦点时,将自动保存未保存的编辑器
  "files.autoSave": "onFocusChange",
  // 字体系列
  "editor.fontFamily": "'Source Code Pro', Consolas, 'Courier New', monospace",
  // 字体大小
  "editor.fontSize": 18,
  // 行高
  "editor.lineHeight": 24,
  // 在一定数量的等宽字符后显示垂直标尺。输入多个值,显示多个标尺。若数组为空,则不绘制标尺
  "editor.rulers": [80, 120],
  // 自动折行显示
  // "editor.wordWrap": "on",
  // 一个制表符等于的空格数
  "editor.tabSize": 2,
  // 控制编辑器在空白字符上显示符号的方式
  "editor.renderWhitespace": "all",
  // 控制编辑器是否显示空白字符
  "editor.renderControlCharacters": true,
  // 控制是否在键入时自动显示建议
  "editor.quickSuggestions": {
    "strings": true
  },
  // 控制编辑器是否使用动画滚动
  "editor.smoothScrolling": true,
  // 在保存时格式化文件。格式化程序必须可用,延迟后文件不能保存,并且编辑器不能关闭
  "editor.formatOnSave": true,
  // 在保存时运行的代码操作类型
  "editor.codeActionsOnSave": {
    // 控制是否应在文件保存时运行自动修复操作
    "source.fixAll": true,
    // "source.fixAll.eslint": true,  // Auto Fix only for ESLint
    // 控制是否应在文件保存时运行 "整理 import 语句" 操作
    "source.organizeImports": true,
    // TypeScript: Adds all missing imports on save
    "source.addMissingImports": true
  },
  // 定义一个默认格式化程序(按 Alt+Shift+F),如果用 VSCode 开发前端代码较多时可以设置为 Prettier
  // "editor.defaultFormatter"
                                
                            
  • katarina
  • Play games and win cash instantly cr598919.tw1.ru nr
  • Access your exclusive time of year bonus cr598919.tw1.ru qq
  • We've located a concealed cash award for you cr598919.tw1.ru ZM
  • Claim your portion of instant cash today cz411953.tw1.ru BE
  • Your cash reward is ready and waiting cz411953.tw1.ru cj
  • Make Cash from Irregular Chores opioeuhweu.temp.swtest.ru VH
  • Build Earnings with Share Trading opioeuhweu.temp.swtest.ru cN
  • Guarantee a Fast Cash Out cz411953.tw1.ru mY
  • Your Financial Gift Awaits   Take It cr598919.tw1.ru Ai
  • An unforeseen monetary award is yours cr598919.tw1.ru 7f
  • This cash bonus is customized for you cz411953.tw1.ru t2
  • Respond quickly to claim an instant prize cr598919.tw1.ru 6r
  • The last allocation of funds is live cz411953.tw1.ru ac
  • Free money is live Claim yours now cr598919.tw1.ru TG
  • Receive Payouts for Being Drawn cr598919.tw1.ru NZ
  • Complete Your Training and Get Paid cr598919.tw1.ru 7p
  • You could win a massive prize opioeuhweu.temp.swtest.ru l9
  • Secure a Bonus to Welcome Your Funds cr598919.tw1.ru tO
  • A confidential cash reserve is yours cz411953.tw1.ru Ur
  • Instant cash prizes await in games cz411953.tw1.ru Du
  • Secure your early adopter bonus today cr598919.tw1.ru Yj
  • Your cash prize is on hold cr598919.tw1.ru 3v
  • Access Monetary Rewards for Education cr598919.tw1.ru 1C
未经允许不得转载: LIFE & SHARE - 王颜公子 » VSCode 配置 Go 开发环境

分享

作者

作者头像

Madman

如需 Linux / Python 相关问题付费解答,请按如下方式联系我

0 条评论

暂时还没有评论.

专题系列