Debugging a Terraform Provider with GoLand

已完成

I'm following the instructions provided by Terraform's docs. I'm looking at the GoLand debug config screen and trying to figure out how to do the same thing there. Is it possible to debug a Terraform provider with GoLand?

I have tried connecting to it as a remote after running

`%GOPATH%\dlv.exe exec --headless .\somebinary.exe -- --debug`

but GoLand's debugger hangs, no connection is shown on the terminal. I did notice pressing the stop button does kill the dlv process though.

Update: I got it working. Two things:

1. I had to run it with: `dlv exec --headless --listen=:51706 --accept-multiclient --api-version=2 .\somebinary.exe -- --debug`

2. Make sure you correctly edit the code provided by terraform with your details.

3. Follow this tutorial for setting up a remote go debug session

0
正式评论

Thanks for the update.

Regarding the remote debug session, please see our documentation here.

请先登录再写评论。