当前位置:   article > 正文

vscode运行配置launch.json_vscode 设置launch.json

vscode 设置launch.json
{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            // 自定义,名字,看起来有意义就行,用来给你选的;
            "name": "test_local_dev",
            // 调试的是 go 程序
            "type": "go",
            // attach 进程的方式
            "request": "launch", // launch
            // auto、debug、remote
            "mode": "debug",
            // 调试的程序,当运行单个文件时{workspaceFolder}可改为{file}
            "program": "${file}", // ${workspaceFolder}/filename or ${file} or ${workspaceFolder}
            "env": {
                // "REDIS_ADDR": "localhost:1270",
                // "REDIS_PWD": ""
            },
            "args": [
                "-f", "server2.json"
            ]
        },
        {
            // 自定义,名字,看起来有意义就行,用来给你选的;
            "name": "test_remote",
            // 调试的是 go 程序
            "type": "go",
            // attach 进程的方式
            "request": "attach", // launch
            // 远程调试
            "mode": "remote",
            // 注意!!非常关键,这是能否成功设置断点的关键参数。
            "remotePath": "{编译的项目路径}",
            // dlv server 启动的端口
            "port": 2345,
            // 远程主机的 IP
            "host": "192.168.56.12"
        }
    ]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43

在这里插入图片描述


工作区配置
在这里插入图片描述

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/770892
推荐阅读
相关标签
  

闽ICP备14008679号