1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 13:35:59 +00:00

formatting

Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-08-17 10:06:20 +03:00
parent 00967408dc
commit 07046ab978
112 changed files with 477 additions and 517 deletions

View File

@@ -491,5 +491,4 @@ func (c *ControllerActivator) handlerOf(m reflect.Method, funcDependencies []ref
hero.DispatchFuncResult(ctx, errorHandler, ctrl.Method(m.Index).Call(emptyIn))
}
}

View File

@@ -23,27 +23,35 @@ var writeMethod = func(ctx context.Context) {
func (c *testController) Get() {
writeMethod(c.Ctx)
}
func (c *testController) Post() {
writeMethod(c.Ctx)
}
func (c *testController) Put() {
writeMethod(c.Ctx)
}
func (c *testController) Delete() {
writeMethod(c.Ctx)
}
func (c *testController) Connect() {
writeMethod(c.Ctx)
}
func (c *testController) Head() {
writeMethod(c.Ctx)
}
func (c *testController) Patch() {
writeMethod(c.Ctx)
}
func (c *testController) Options() {
writeMethod(c.Ctx)
}
func (c *testController) Trace() {
writeMethod(c.Ctx)
}
@@ -333,7 +341,7 @@ func (c *testCtrl0) EndRequest(ctx context.Context) {
ctx.Writef(c.TitlePointer.title)
}
//should be the same as `.testCtrl000.testCtrl0000.EndRequest(ctx)`
// should be the same as `.testCtrl000.testCtrl0000.EndRequest(ctx)`
c.testCtrl00.EndRequest(ctx)
}
@@ -441,7 +449,6 @@ func TestControllerRelPathFromFunc(t *testing.T) {
Body().Equal("GET:/42")
e.GET("/anything/here").Expect().Status(iris.StatusOK).
Body().Equal("GET:/anything/here")
}
type testControllerActivateListener struct {

View File

@@ -14,8 +14,6 @@ type (
View = hero.View
)
var (
// Try is a type alias for the `hero#Try`,
// useful to return a result based on two cases: failure(including panics) and a succeess.
Try = hero.Try
)
// Try is a type alias for the `hero#Try`,
// useful to return a result based on two cases: failure(including panics) and a succeess.
var Try = hero.Try

View File

@@ -13,21 +13,19 @@ import (
"github.com/kataras/golog"
)
var (
// HeroDependencies let you share bindable dependencies between
// package-level hero's registered dependencies and all MVC instances that comes later.
//
// `hero.Register(...)`
// `myMVC := mvc.New(app.Party(...))`
// the "myMVC" registers the dependencies provided by the `hero.Register` func
// automatically.
//
// Set it to false to disable that behavior, you have to use the `mvc#Register`
// even if you had register dependencies with the `hero` package.
//
// Defaults to true.
HeroDependencies = true
)
// HeroDependencies let you share bindable dependencies between
// package-level hero's registered dependencies and all MVC instances that comes later.
//
// `hero.Register(...)`
// `myMVC := mvc.New(app.Party(...))`
// the "myMVC" registers the dependencies provided by the `hero.Register` func
// automatically.
//
// Set it to false to disable that behavior, you have to use the `mvc#Register`
// even if you had register dependencies with the `hero` package.
//
// Defaults to true.
var HeroDependencies = true
// Application is the high-level component of the "mvc" package.
// It's the API that you will be using to register controllers among with their