INNER CODE UNIT · Go

CreateOSEntityWorkers

joshuar/go-hass-agent · agent/entity_workers_darwin.go:21

func CreateOSEntityWorkers(ctx context.Context) []workers.EntityWorker {
	osWorkers := make([]workers.EntityWorker, 0, len(macosWorkers))

	for workerInit := range slices.Values(macosWorkers) {
		worker, err := workerInit(ctx)

		if err != nil {
			slogctx.FromCtx(ctx).Warn("Could not init worker.",
				slog.String("worker", worker.ID()),
				slog.Any("error", err))

			continue
		}

		osWorkers = append(osWorkers, worker)
	}

	return osWorkers

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…