I found the problem and solution.
The problem is that I am using macos (silicone) and nakana image does not have tag for arm:
http://registry.heroiclabs.com/heroiclabs/nakama-dsym:3.16.0
As I found out that’s creating problem with debugging capabilities using delve.
The solution:
Build your plugin-builder and Nakama image suitable for arm architecture.
git clone git@github.com:heroiclabs/nakama.git
git checkout {your_specific_version} e.g v3.16.0
cd build
in Dockerfile.dsym: change ENV GOARCH amd64 to ENV GOARCH arm64
docker build "$PWD" --platform "linux/arm64" --file ./Dockerfile.dsym --build-arg commit="$(git rev-parse --short HEAD 2>/dev/null)" --build-arg version=3.16.0 -t heroiclabs/nakama-dsym:3.16.0
One image is ready, now make plugin-builder;
cd pluginbuilder
in Dockerfile: change ENV GOARCH amd64 to ENV GOARCH arm64
docker build "$PWD" --platform "linux/arm64" --file ./Dockerfile --build-arg commit="$(git rev-parse --short HEAD 2>/dev/null)" --build-arg version=3.16.0 -t heroiclabs/nakama-pluginbuilder-custom:3.16.0
use your freshly built images in your Dockerfile.
This is the link I used for building images:
https://github.com/heroiclabs/nakama/tree/master/build
regarding actual breakpoint in code:
I was unable to use breakpoints like it’s mentioned in the document (wanted to place a link but some restrictions…)
instead placed:
runtime.Breakpoint()
but as runtime is imported as Nakama package had to import and use it like this
import (
rt "runtime"
)
func InitModule(ctx context.Context, logger runtime.Logger, db *sql.DB, nk runtime.NakamaModule, initializer runtime.Initializer) error {
rt.Breakpoint()
Hope this helps anyone.