1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 04:17:03 +00:00

simplify by join the bind registration(ctx-transformer-to-something-func-binder and service one, which just sets the struct as it's) to one named 'In' and create a 'Child' which will return a new mvc instance with binders inheritanced from the parent one and add a simple test to the mvc_test.go - will have more later on

Former-commit-id: 81ae99390c683a61e1b0bac58725a04b9a3eebbb
This commit is contained in:
kataras
2017-11-24 17:34:35 +02:00
parent 29835d9a8e
commit 5a3be2ab58
5 changed files with 111 additions and 56 deletions

View File

@@ -22,15 +22,8 @@ func testBinderFunc(ctx context.Context) testUserStruct {
}
}
type testBinderStruct struct{}
func (t *testBinderStruct) Bind(ctx context.Context) testUserStruct {
return testBinderFunc(ctx)
}
func TestMakeFuncInputBinder(t *testing.T) {
testMakeFuncInputBinder(t, testBinderFunc)
testMakeFuncInputBinder(t, new(testBinderStruct))
}
func testMakeFuncInputBinder(t *testing.T, binder interface{}) {