VSCode 配置 Go 开发环境

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

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
  • Claim a Reward Just for Registering iuhilhifhd.temp.swtest.ru bX
  • This monetary offer is nearing its end ct731714.tw1.ru 0j
  • Receive a cash reward for commenting ct731714.tw1.ru UT
  • A special reserved bonus awaits you iuhilhifhd.temp.swtest.ru IK
  • Score a Monetary Reward Instantly ct731714.tw1.ru f8
  • sznpflxver
  • Trade to Get Monetary Rewards iuhilhifhd.temp.swtest.ru Uu
  • Gain Incentives by Being Involved cu673950.tw1.ru tu
  • You have an unclaimed monetary gift iuhilhifhd.temp.swtest.ru lc
  • Celebrate with us Your gift is inside cu673950.tw1.ru h5
  • Sample this and receive free money cu673950.tw1.ru bd
  • You are the recipient of undisclosed money cu673950.tw1.ru Mf
  • Come Into a Sum of Money Now cu673950.tw1.ru SC
  • Receive Your Funds Promptly ct731714.tw1.ru Ef
  • Self Education Can Be Lucrative cu673950.tw1.ru 3G
  • Monetize Your Individuality iuhilhifhd.temp.swtest.ru 0g
  • The VIP reward deadline is approaching cu673950.tw1.ru n0
  • A reserve of cash kept private for you ct731714.tw1.ru Vc
  • xmlxdmtpsr
  • Be a Victor for Quick Cash ct731714.tw1.ru U6
  • Click to receive your instant cash prize cu673950.tw1.ru ge
  • Get a monetary reward for voting cu673950.tw1.ru g6
  • Respond for an immediate cash reward cu673950.tw1.ru 4q
未经允许不得转载: LIFE & SHARE - 王颜公子 » VSCode 配置 Go 开发环境

分享

作者

作者头像

Madman

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

0 条评论

暂时还没有评论.

专题系列