我正在为 golang 使用 Revel 框架。我的 Controller 文件夹中有一个子目录,如下所示
controllers
new
app2.go
app1.go
app1.go 的内容
package controllers
import (
"github.com/revel/revel"
)
type APP1 struct {
*revel.Controller
}
func (c APP1) Show() revel.Result {
}
app2.go 的内容
import (
"github.com/revel/revel"
)
type APP2 struct {
*revel.Controller
}
func (c APP2) Show() revel.Result {
}
我的路由文件是这样的
GET /v1/show APP1.show
GET /v2/show APP2.show
当我调用/v2/show 时,它给我错误 failed to find controller APP2 while v1/show is working absolutely working fine。谁能告诉我如何解决它。
最佳答案
像这样配置 APP2.show 的路由 GET/new/v2/show
关于go - Revel Framework - Go Lang - 无法找到 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38988686/