func startGatheringConcurrently(
	ctx context.Context, gatherer gatherers.Interface, enabledFunctions []string,
) (chan GatheringFunctionResult, error) {
	gathererName := gatherer.GetName()

	gatherAllFunctions, gatherFunctionsList := getListOfEnabledFunctionForGatherer(
		gathererName, enabledFunctions,
	)
	if !gatherAllFunctions && len(gatherFunctionsList) == 0 {
		return nil, fmt.Errorf("no gather functions are specified to run")
	}

	var tasks []Task

	for functionName, gatheringClosure := range gatherer.GetGatheringFunctions() {
		if !gatherAllFunctions && !utils.StringInSlice(functionName, gatherFunctionsList) {
			continue
		}

		tasks = append(tasks, Task{
			Name: functionName,
			F:    gatheringClosure,
		})
	}

	return HandleTasksConcurrently(ctx, tasks), nil
}
// startGatheringConcurrently starts gathering of enabled functions of the provided gatherer and returns a channel
// with results which will be closed when processing is done
startGatheringConcurrently starts gathering of enabled functions of the provided gatherer and returns a channel
with results which will be closed when processing is done
// startGatheringConcurrently starts gathering of enabled functions of the provided gatherer and returns a channel // with results which will be closed when processing is done
func startGatheringConcurrently(
	ctx context.Context, gatherer gatherers.Interface, enabledFunctions []string,
) (chan GatheringFunctionResult, error) {
	gathererName := gatherer.GetName()
	gatherAllFunctions, gatherFunctionsList := getListOfEnabledFunctionForGatherer(
		gathererName, enabledFunctions,
	)
	if !gatherAllFunctions && len(gatherFunctionsList) == 0 {
		return nil, fmt.Errorf("no gather functions are specified to run")
	}
	var tasks []Task
	for functionName, gatheringClosure := range gatherer.GetGatheringFunctions() {
		if !gatherAllFunctions && !utils.StringInSlice(functionName, gatherFunctionsList) {
			continue
		}
		tasks = append(tasks, Task{
			Name: functionName,
			F:    gatheringClosure,
		})
	}
	return HandleTasksConcurrently(ctx, tasks), nil
}
func startGatheringConcurrently ( ctx context . Context , gatherer gatherers . Interface , enabledFunctions [ ] string , ) ( chan GatheringFunctionResult , error ) { gathererName := gatherer . GetName ( ) gatherAllFunctions , gatherFunctionsList := getListOfEnabledFunctionForGatherer ( gathererName , enabledFunctions , ) if ! gatherAllFunctions && len ( gatherFunctionsList ) == 0 { return nil , fmt . Errorf ( " " ) } var tasks [ ] Task for functionName , gatheringClosure := range gatherer . GetGatheringFunctions ( ) { if ! gatherAllFunctions && ! utils . StringInSlice ( functionName , gatherFunctionsList ) { continue } tasks = append ( tasks , Task { Name : functionName , F : gatheringClosure , } ) } return HandleTasksConcurrently ( ctx , tasks ) , nil }
startGatheringConcurrently starts gathering of enabled functions of the provided gatherer and returns a channel
with results which will be closed when processing is done
startGatheringConcurrently starts gathering of enabled functions of the provided gatherer and returns a channel with results which will be closed when processing is done