[英]How do I debug a go app started with heroku local web in vscode
I have a go app deploying on heroku.我有一个 go 应用程序部署在 heroku 上。 usually I start with
heroku local web
and attach debugger later by find process id.通常我从
heroku local web
开始,稍后通过查找进程 ID 附加调试器。
how can I start into debug mode?我怎样才能进入调试模式?
Thanks谢谢
this may not be the best answer, the only thing I need for debug is load.env in the first place, which heroku cli did that.这可能不是最好的答案,我唯一需要调试的是 load.env 首先,heroku cli 做到了。 I figured vscode allows set a envFile in the launch config.
我认为 vscode 允许在启动配置中设置一个 envFile。
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceRoot}/main.go",
"envFile": "${workspaceFolder}/.env"
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.