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

Method GetJson

mvc/controller_method_result_test.go:36–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36func (c *testControllerMethodResult) GetJson() Result {
37 var err error
38 if c.Ctx.URLParamExists("err") {
39 err = errors.New("error here")
40 }
41 return Response{
42 Err: err, // if err != nil then it will fire the error's text with a BadRequest.
43 Object: testCustomStruct{Name: "Iris", Age: 2},
44 }
45}
46
47var things = []string{"thing 0", "thing 1", "thing 2"}
48

Callers

nothing calls this directly

Calls 2

URLParamExistsMethod · 0.80
NewMethod · 0.80

Tested by

no test coverage detected