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.

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


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.


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.


Guiding developers to resolve the goland debug related problems.

Hi BOFA1ex,

Thanks for the plugins!

I managed to breakpoint using Goland based on your plugin and documentation.

I triggered the RpcTest call from the admin local website, however my breakpoint is a bit weird, when the program hit a breakpoint, the Goland breakpoint line doesnt turn to blue like it always does. and the code line from the breakpoint data does not match my actual code file’s line (function call is at line 16 but the breakpoint data shows it is main.go:17)

here is my docker compose’s entrypoint config

      - "/bin/sh"
      - "-ecx"
      - >
        /nakama/nakama migrate up --database.address postgres:localdb@postgres:5432/nakama &&
        /nakama/dlv --log --log-output=debugger --listen=:4000 --headless=true --accept-multiclient --api-version=2 exec nakama -- --config /nakama/data/local.yml --database.address postgres:localdb@postgres:5432/nakama

here is my docker file

FROM heroiclabs/nakama-pluginbuilder:3.21.1 AS go-builder


WORKDIR /backend

RUN apt-get update && \
    apt-get -y upgrade && \
    apt-get install -y --no-install-recommends gcc libc6-dev

RUN go install github.com/go-delve/delve/cmd/dlv@latest

COPY go.mod .
COPY src/*.go .
COPY vendor/ vendor/

RUN go build --trimpath --gcflags "all=-N -l" --mod=vendor --buildmode=plugin -o ./backend.so

FROM registry.heroiclabs.com/heroiclabs/nakama-dsym:3.21.1

COPY --from=go-builder /go/bin/dlv /nakama
COPY --from=go-builder /backend/backend.so /nakama/data/modules/
COPY local.yml /nakama/data/

can you tell what i did wrongly ? thank you for your time i would really appreciate if you could help me take a look

Please report issues over GitHub - BOFA1ex/dlvx, thanks.