About using goland debugger

With some minor modifications to the directions in Debugging with Delve guide, and then debug your custom Go server runtime code using Delve inside a Docker container via Goland.

Diff than Heroic Labs Documentation | Using VSCode Debugger
There did not recommand to define extra-properties file.

Install Goland plugin

It only required install the dlvx plugin on jetbrain plugin marketplace.

Debugging and Setting Breakpoints

With the above changes in place, go to the Edit Configurations… view in Goland by clicking the button shown below.
image

And Click + toggle the treelist of configuration type, it shows Dlvx Go Remote to choose after dlvx plugin install successful.

Warnning Dlvx Go Remote was different from the official Go Remote in internal implementation

image

Typing the local-nakama-server dlv listening port 4000

Now launch the debugger by clicking the play button at the top of the Run and Debug panel.

image

Breaking on an RPC

Now let’s say we want to debug a call to an RPC. In the following example, we have registered an RPC inside the InitModule function. The function name of the RPC is SomeRpc .

Set GoFunction breakpoint on SomeRpc

We now need to trigger the RPC. We can do this either by calling it from a client or by visiting the Nakama Console in a browser and using the API explorer. Once the RPC has been triggered, you should see that Goland successfully hits the breakpoint and you can now use the standard debugging tools (e.g. Variables, Locals, Step Into, Step Over etc) as you would expect.

2 Likes

Guiding developers to resolve the goland debug related problems.