使用 IntelliJ 进行调试
Debugging revel with IntelliJ
我们如何配置 IntelliJ 来调试 Revel 应用程序?
在 Run/Debug Configurations
中,为 File
、Go tool arguments
和 Program arguments
输入什么一点都不明显
创建你的项目,对于这个例子我将使用规范 revel new github.com/myaccount/my-app
- 运行 在终端
revel run github.com/myaccount/my-app
中生成 tmp/main.go
- intellij 需要 这个文件
- Select“编辑配置”创建
Run configuration
。 SelectGo Build
- Select 你的文件“main.go”
- 粘贴到“程序参数”字符串中
-importPath github.com\myaccount\my-app
- 单击“启动前:...”并创建“运行 外部工具”
- 那里:程序:
<your gopath>/bin/revel
(Windows - revel.exe) 参数:build github.com/myaccount/my-app
,工作目录 <your gopath>/bin
Screenshot 示例配置
现在您可以 运行 并在 IntelliJ 面板中调试
我们如何配置 IntelliJ 来调试 Revel 应用程序?
在 Run/Debug Configurations
中,为 File
、Go tool arguments
和 Program arguments
创建你的项目,对于这个例子我将使用规范 revel new github.com/myaccount/my-app
- 运行 在终端
revel run github.com/myaccount/my-app
中生成tmp/main.go
- intellij 需要 这个文件
- Select“编辑配置”创建
Run configuration
。 SelectGo Build
- Select 你的文件“main.go”
- 粘贴到“程序参数”字符串中
-importPath github.com\myaccount\my-app
- 单击“启动前:...”并创建“运行 外部工具”
- 那里:程序:
<your gopath>/bin/revel
(Windows - revel.exe) 参数:build github.com/myaccount/my-app
,工作目录<your gopath>/bin
Screenshot 示例配置
现在您可以 运行 并在 IntelliJ 面板中调试