VSCode 配置 Go 开发环境

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

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
  • Carefully chosen gift for you ygjhbgmail.temp.swtest.ru Nc
  • Unlock Your Reward cr077152.tw1.ru NB
  • Receive Your Verified Bonus Funds ci519550.tw1.ru EA
  • Withdraw your funds instantly ci519550.tw1.ru J9
  • Access Your Top-Tier Player Payout ci519550.tw1.ru qg
  • Obtain Your Braced Cash ygjhbgmail.temp.swtest.ru vr
  • Get your solid money present ci519550.tw1.ru hU
  • Secure Your Solid Extra Return ygjhbgmail.temp.swtest.ru 9w
  • Activate Your Credits cr077152.tw1.ru 8S
  • Wallet Transfer Complete ci519550.tw1.ru q3
  • Acquire Your Noticeable Loyalty Payout cr077152.tw1.ru LZ
  • Lock In Your Digital Capital Dividend cr077152.tw1.ru ZS
  • Get your abundant reward here ygjhbgmail.temp.swtest.ru aN
  • Gather Your Influential Reward ci519550.tw1.ru UX
  • Start Your Extra cr077152.tw1.ru J9
  • Exchange Your Quick Account Bonus ygjhbgmail.temp.swtest.ru Ab
  • Quick Bonus Claim cr077152.tw1.ru 7f
  • Reach Your Best-Level Prize cr077152.tw1.ru Zl
  • Request Your Sharp Turns ci519550.tw1.ru zD
  • Reveal your hidden prize here ygjhbgmail.temp.swtest.ru lb
  • Collect Your Notable Prize ci519550.tw1.ru k8
  • Enjoy Your Reward cr077152.tw1.ru Up
  • Withdraw your bonus instantly ygjhbgmail.temp.swtest.ru Ms
未经允许不得转载: LIFE & SHARE - 王颜公子 » VSCode 配置 Go 开发环境

分享

作者

作者头像

Madman

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

0 条评论

暂时还没有评论.

专题系列