How to start Grafana in debug mode?

I’m using Gogland to debug Grafana backend code. I can ‘Run’ grafana-server/main.go just fine, and server starts at port 3000. But when I use ‘Debug’, there’s only a message says ‘API server listening at:’. I can’t connect to that address and any breakpoints I set in main are not called.Please let me know if I’m doing anything wrong and what’s the best approach for debugging backend code.

you do not need to start grafana in any specific way to debug it. Not familiar with Gogland.