MCPcopy Create free account
hub / github.com/kataras/iris / writeModels

Function writeModels

mvc/controller_test.go:213–235  ·  view source on GitHub ↗
(ctx *context.Context, names ...string)

Source from the content-addressed store, hash-verified

211}
212
213func writeModels(ctx *context.Context, names ...string) {
214 if expected, got := len(names), len(ctx.GetViewData()); expected != got {
215 ctx.Writef("expected view data length: %d but got: %d for names: %s", expected, got, names)
216 return
217 }
218
219 for _, name := range names {
220
221 m, ok := ctx.GetViewData()[name]
222 if !ok {
223 ctx.Writef("fail load and set the %s", name)
224 return
225 }
226
227 model, ok := m.(Model)
228 if !ok {
229 ctx.Writef("fail to override the %s' name by the tag", name)
230 return
231 }
232
233 ctx.Writef(model.Username)
234 }
235}
236
237func (c *testControllerEndRequestAwareness) BeginRequest(ctx *context.Context) {}
238func (c *testControllerEndRequestAwareness) EndRequest(ctx *context.Context) {

Callers 1

EndRequestMethod · 0.85

Calls 2

GetViewDataMethod · 0.80
WritefMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…