VSCode 配置 Go 开发环境

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

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
  • Take possession of your USD75 today cv039824.tw1.ru w6
  • This message packs a bonus punch cv039824.tw1.ru px
  • You've reclaimed currency that had vanished cc032601.tw1.ru QT
  • Make Your Financial Reward Safe cv039824.tw1.ru 8Q
  • Sign up for the free giveaway and earn cv039824.tw1.ru 5V
  • Gain Entry to Secret Price Cuts and Payouts cc032601.tw1.ru 3Z
  • Secure your bonus before the night ends cc032601.tw1.ru yx
  • Complete tests and get cash cc032601.tw1.ru x4
  • qezouhehro
  • A mysterious monetary sum has come to light cc032601.tw1.ru Jy
  • Ensure You Receive Your Cash Reward cc032601.tw1.ru ty
  • We'll Match Your First Deposit with a Bonus cv039824.tw1.ru Cs
  • Snag your additional cash bonus now cc032601.tw1.ru dB
  • Reply and get an instant reward cv039824.tw1.ru Fh
  • Notification Unexpected funds incoming cc032601.tw1.ru YH
  • Don't leave your cash reward unclaimed cc032601.tw1.ru uo
  • A remittance awaits your approval cv039824.tw1.ru BG
  • Don't lose your loyalty funds lyuofutykc.temp.swtest.ru Bc
  • Get a cash bonus designed around you cv039824.tw1.ru 8r
  • Take Hold of Your Cash Compensation cc032601.tw1.ru zI
  • Get a Financial Perk for Signing Up lyuofutykc.temp.swtest.ru pl
  • There's a cash bonus with your name on it cc032601.tw1.ru sv
  • infvkkjqjt
未经允许不得转载: LIFE & SHARE - 王颜公子 » VSCode 配置 Go 开发环境

分享

作者

作者头像

Madman

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

0 条评论

暂时还没有评论.

专题系列