dow57588 2016-08-17 05:25
浏览 69

Revel框架-Go语言-无法找到控制器

I am using Revel framework for golang. I have a subdirectory in my controllers folder like below

controllers
   new
     app2.go
   app1.go

Contents of app1.go

package controllers

import (
    "github.com/revel/revel"
)

type APP1 struct {
    *revel.Controller
}
func (c APP1) Show() revel.Result {
}

Contents of app2.go

import (
    "github.com/revel/revel"
)

type APP2 struct {
    *revel.Controller
}
func (c APP2) Show() revel.Result {
}

My routes file is like this

GET     /v1/show              APP1.show
GET     /v2/show              APP2.show

When I call /v2/show it gives me error failed to find controller APP2 while v1/show is working absolutely working fine. Can anybody tell me how to fix it.

  • 写回答

3条回答 默认 最新

  • dongnaopa6200 2016-08-25 07:39
    关注

    Configure the route for APP2.show like this GET /new/v2/show

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog