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:
@@ -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{}) {
|
||||
|
||||
Reference in New Issue
Block a user