vscode golang debug配置


本文摘自网络,作者,侵删。

  • 在项目根目录下创建.vscode/launch.json
  • 输入类似配置保存
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceRoot}/main.go",
            "buildFlags":"-mod=vendor", // 使用vendor模式
            "env": {"xxxEnv":"on"}, // 环境变量
            "args": ["-config","xxx.toml"] // 启动参数
        }
    ]
}

本文来自:简书

感谢作者:凯文不上班

查看原文:vscode golang debug配置

相关阅读 >>

Go text/template

[译]Go语言最佳实战[一]

教你使用Golang实现redis服务器

Golang 快餐 - 环境变量

Go+python双语言混合开发

Go实现ssh远程执行命令

Golang in pingcap

手撸Golang 结构型设计模式 代理模式

Golang如何实现简单的api网关

Go并发处理

更多相关阅读请进入《Go》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...