美文网首页
vscode 调试golang web application

vscode 调试golang web application

作者: 刀鳅 | 来源:发表于2017-02-23 16:57 被阅读0次

    1.配置tasks.json

    {

    "version": "0.1.0",

    "command": "go",

    "isShellCommand": true,

    "showOutput": "always",

    "args": ["run","${file}"],

    "isBuildCommand": true,

    "taskSelector": "/t:"

    }

    2.配置launch.json

    {

    "version": "0.2.0",

    "configurations": [

    {

    "name": "debug",

    "type": "go",

    "request": "launch",

    "mode": "debug",

    "remotePath": "",

    "port": 8080,

    "host": "127.0.0.1",

    "program": "${workspaceRoot}/final.go",

    "env": {},

    "args": []

    //"showLog": true

    }

    ]

    }

    3.打开调试面板(ctrl+shit+d)

         选择配置的调试“debug”

          在调试控制台如果出现 API server listening at: 127.0.0.1:8080(这个是自己配置的地址和端口号)表示成功了

          在浏览器中输入url,进入所打的断点

    相关文章

      网友评论

          本文标题:vscode 调试golang web application

          本文链接:https://www.haomeiwen.com/subject/jbcaettx.html