I am working on beego application. I am trying to run the same code in two different machine. Both are ubuntu. In one machine, it runs without any problem but in other I got following error log. I have the same file organization for both, why do you think this might be happening?
controllers/EventController.go:18: this.ServeJson undefined (type *EventController has no field or method ServeJson)
controllers/EventController.go:24: this.ServeJson undefined (type *EventController has no field or method ServeJson)
controllers/EventController.go:30: this.ServeJson undefined (type *EventController has no field or method ServeJson)
controllers/default.go:14: c.TplNames undefined (type *MainController has no field or method TplNames)
Even controller:
package controllers
import (
"github.com/astaxie/beego"
"solardatabase/models"
"solardatabase/dao"
"solardatabase/services"
)
type EventController struct {
beego.Controller
}
func (this *EventController) ListEvents() {
res := struct{ Tasks []*models.Event }{dao.GetAllEvents()}
this.Data["json"] = res
this.ServeJson()
}
func (this *EventController) ListEventsByRange() {
request, _ := models.CreateEventByTimeRangeRequest(this.Ctx.Input)
this.Data["json"] = dao.EventsByTimeRange(request)
this.ServeJson()
}
func (this *EventController) TemporalQuery() {
request, _ := models.CreateTemporalRequest(this.Ctx.Input)
this.Data["json"] = services.EventsByTimeFilter(request)
this.ServeJson()
}