go get github.com/derekparker/delve/cmd/dlv
然后配置下面的launch.json
```
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceFolder}/src/missfresh.net/product-center/main.go", //自定义
"buildFlags": "-tags etcd",//自定义
"env": {},
"args": [],
"showLog": true
}
]
}
```