godebug is a code-generation-based debugger for Go. It is currently in alpha stage -- expect problems.
$ go get github.com/mailgun/godebug
First, get your directory in a clean state. The command below will overwrite your files, so make sure you have committed or stashed everything.
In any file where you want a breakpoint, import github.com/mailgun/godebug/lib and insert this breakpoint anywhere in the code: godebug.SetTrace(). Then run:
$ godebug -w .
Your code is now self-debugging. Congrats! Run it with go run, test it with go test, or build then run it with go build.
The debugger is currently extremely limited. The commands are:
| command | result |
|---|---|
| n(ext) | run until the next line |
| s(tep) | run for one step |
| p(rint) [var] | print a variable |
The debugger will attempt to interpret any text that does not match the above commands as a variable name. If that variable exists, the debugger will print it.
$ claude mcp add godebug \
-- python -m otcore.mcp_server <graph>