func validateLifeCycleArguments()

in fc/life_cycle_handler.go [31:42]


func validateLifeCycleArguments(handler reflect.Type) error {
	if handler.NumIn() != 1 {
		return fmt.Errorf("life cycle handler should takes one arguments, but handler takes %d", handler.NumIn())
	}
	contextType := reflect.TypeOf((*context.Context)(nil)).Elem()
	argumentType := handler.In(0)
	if !argumentType.Implements(contextType) {
		return fmt.Errorf("handler takes a single arguments, but it is not Context. got %s",
			argumentType.Kind())
	}
	return nil
}