debuggingintellij-idearevel

Debugging revel with IntelliJ


How can we configure IntelliJ to debug revel apps?

In Run/Debug Configurations, it's not at all obvious what to enter for File, Go tool arguments, and and Program arguments


Solution

  • Create your project, for this example i will be using canonical revel new github.com/myaccount/my-app

    1. Run in terminal revel run github.com/myaccount/my-app to generate tmp/main.go - this file is needed by intellij
    2. Select "Edit configuration" to create Run configuration. Select Go Build
    3. Select YOUR file "main.go"
    4. Paste in "Program arguments" string -importPath github.com\myaccount\my-app
    5. Click on "Before launch: ..." and create "Run external tool"
    6. There: Program: <your gopath>/bin/revel(Windows - revel.exe) Paramerets: build github.com/myaccount/my-app, Working dir <your gopath>/bin

    Screenshot Example Config

    Now You can Run and Debug in panel IntelliJ