简体   繁体   中英

How do I debug a go app started with heroku local web in vscode

I have a go app deploying on heroku. usually I start with heroku local web and attach debugger later by find process 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. I figured vscode allows set a envFile in the launch config.

{

    "version": "0.2.0",
    "configurations": [
        
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceRoot}/main.go",
            "envFile": "${workspaceFolder}/.env"
        }
    ]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM