(ctx *context.Context, names ...string)
| 211 | } |
| 212 | |
| 213 | func 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 | |
| 237 | func (c *testControllerEndRequestAwareness) BeginRequest(ctx *context.Context) {} |
| 238 | func (c *testControllerEndRequestAwareness) EndRequest(ctx *context.Context) { |
no test coverage detected
searching dependent graphs…