VSCode 配置 Go 开发环境

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

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
  • The contents hold an unexpected money gift cx953449.tw1.ru VH
  • A custom crafted reward for you cx953449.tw1.ru ug
  • This exclusive deal lasts 12 hours cd091393.tw1.ru vN
  • Gain Entry to Secret Price Cuts and Payouts cx953449.tw1.ru Fu
  • The Time to Claim Your Bonus is Now cd091393.tw1.ru QY
  • A grand prize in cash awaits your action cd091393.tw1.ru BE
  • Vote and collect your earnings cx953449.tw1.ru Va
  • Unlock your weekend specific cash promotion cd091393.tw1.ru A3
  • Complimentary money with no obligations cd091393.tw1.ru I1
  • You've unlocked a personal vault of value cd091393.tw1.ru oh
  • This bonus is reserved in your name cd091393.tw1.ru PV
  • Quick cash for downloading oiawqjgmai.temp.swtest.ru 9Y
  • A one day exclusive offer complimentary cash cx953449.tw1.ru E7
  • Unlock your surprise cash gift cx953449.tw1.ru cI
  • Triumph and Get Cash Instantly cx953449.tw1.ru QI
  • Take this cash with no questions asked cx953449.tw1.ru z4
  • Last cash payout happening now cd091393.tw1.ru 3s
  • Don't miss this day long cash opportunity cd091393.tw1.ru Gq
  • The USD50 bonus is yours for the taking cx953449.tw1.ru q5
  • Receive an unexpected cash bonus oiawqjgmai.temp.swtest.ru gd
  • Generate Quick Cash on the Side cd091393.tw1.ru LO
  • Capital once at rest is now active cx953449.tw1.ru 8m
  • Reply and get an instant reward cd091393.tw1.ru WV
未经允许不得转载: LIFE & SHARE - 王颜公子 » VSCode 配置 Go 开发环境

分享

作者

作者头像

Madman

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

0 条评论

暂时还没有评论.

专题系列