beego 报错 panic method doesnt exist in the controller Controller

beego panic: method doesn’t exist in the controller Controller

删除beego框架的controller函数后发现报错,beego panic: ‘xx’ method doesn’t exist in the controller xxController。

原因是还有残留记录,只删除controller里面的函数是不足够的,如果采用注释路由还需要删除routers文件夹里面的函数
文件名字为:commtentsRouter____yourprojectpath_controllers.go

如删除了TestController的Update函数,则需要删除上述文件中的此函数。

beego.GlobalControllerRouter["test/controllers:TestController"] = append(beego.GlobalControllerRouter["test/controllers:TestController"],
    beego.ControllerComments{
        Method: "Update",
        Router: `/update`,
        AllowHTTPMethods: []string{"get"},
        MethodParams: param.Make(),
        Filters: nil,
        Params: nil})

你可能感兴趣的:(Beego)