// Use reflection to call the correct test function passing in the context.
Use reflection to call the correct test function passing in the context.
// Use reflection to call the correct test function passing in the context .
func call(funcName string, params ...interface{}) (result interface{}, err error) {
	f := reflect.ValueOf(tests[funcName])
	if len(params) != f.Type().NumIn() {
		err = errors.New("The number of params is out of index.")
		return
	}
	in := make([]reflect.Value, len(params))
	for k, param := range params {
		in[k] = reflect.ValueOf(param)
	}
	f.Call(in)
	return
}
func call ( funcName string , params ... interface { } ) ( result interface { } , err error ) { f := reflect . ValueOf ( tests [ funcName ] ) if len ( params ) != f . Type ( ) . NumIn ( ) { err = errors . New ( " " ) return } in := make ( [ ] reflect . Value , len ( params ) ) for k , param := range params { in [ k ] = reflect . ValueOf ( param ) } f . Call ( in ) return }
Use reflection to call the correct test function passing in the context.
Use reflection to call the correct test function passing in the context .