Debugging Go is a pain. I am not sure why the designers of this language did not include a debugger in the toolchain.
In any case, GDB can be used to debug this wonderful language and I discovered that QtCreator is an alright frontend.
There a few steps needed to set this up:
- Configure gdb to load the go bindings
- In ~/.gdbinit add this:
source /usr/share/go/src/runtime/runtime-gdb.py
- In QtCreator go to Tool->Options->Text Editor; Generic Highlighter clock Download Definitions… and get “Go”
- Configure a project with your Go sources as New Project->Import Project->Import Existing Project
- In the run configuration set the path and the arguments for your built go binary program
- In ~/.gdbinit add this:
Hope this helps!