使用 IntelliJ 进行调试

Debugging revel with IntelliJ

我们如何配置 IntelliJ 来调试 Revel 应用程序?

Run/Debug Configurations 中,为 FileGo tool argumentsProgram arguments

输入什么一点都不明显

创建你的项目,对于这个例子我将使用规范 revel new github.com/myaccount/my-app

  1. 运行 在终端 revel run github.com/myaccount/my-app 中生成 tmp/main.go - intellij
  2. 需要 这个文件
  3. Select“编辑配置”创建Run configuration。 SelectGo Build
  4. Select 你的文件“main.go”
  5. 粘贴到“程序参数”字符串中-importPath github.com\myaccount\my-app
  6. 单击“启动前:...”并创建“运行 外部工具”
  7. 那里:程序:<your gopath>/bin/revel(Windows - revel.exe) 参数:build github.com/myaccount/my-app,工作目录 <your gopath>/bin

Screenshot 示例配置

现在您可以 运行 并在 IntelliJ 面板中调试