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 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用