Closed mei-rune closed 8 years ago
old code is
func (t tControllers) newC(w http.ResponseWriter, r *http.Request, ctr, act string) *contr.Controllers { // Allocate a new controller. Set values of special fields, if necessary. c := &contr.Controllers{} // Allocate its parents. Make sure controller of every type // is allocated just once, then reused. c.Templates = c.Errors.Templates c.Errors = &c5.Errors{} c.Static = &c3.Static{} c.Sessions = &c2.Sessions{ Request: r, Response: w, } c.Requests = &c1.Requests{ Request: r, Response: w, } c.Global = &c0.Global{ CurrentAction: act, CurrentController: ctr, } c.Errors.Templates = &c4.Templates{} c.Errors.Templates.Requests = c.Requests c.Errors.Templates.Global = c.Global c.Templates.Requests = c.Requests c.Templates.Global = c.Global return c }
new code is
func (t tControllers) newC(w http.ResponseWriter, r *http.Request, ctr, act string) *contr.Controllers { // Allocate a new controller. Set values of special fields, if necessary. c := &contr.Controllers{} // Allocate its parents. Make sure controller of every type // is allocated just once, then reused. c.Templates = &c4.Templates{} c.Errors = &c5.Errors{} c.Static = &c3.Static{} c.Sessions = &c2.Sessions{ Request: r, Response: w, } c.Requests = &c1.Requests{ Request: r, Response: w, } c.Global = &c0.Global{ CurrentAction: act, CurrentController: ctr, } c.Errors.Templates = c.Templates c.Templates.Requests = c.Requests c.Templates.Global = c.Global return c }
old code is
new code is