Update cmd/survey/survey.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Robin Olsen
2026-02-12 23:59:12 +01:00
committed by GitHub
parent d12146462f
commit fdfe4aa620

View File

@@ -21,18 +21,18 @@ func main() {
} }
defer close() defer close()
tasks := initTasks() surveyTasks := initTasks()
interfaces := initInterfaces() interfaces := initInterfaces()
if err := taskLoop(ctx, svc, tasks, interfaces); err != nil { if err := taskLoop(ctx, svc, surveyTasks, interfaces); err != nil {
log.Fatalf("Task loop failed: %v\n", err) log.Fatalf("Task loop failed: %v\n", err)
} }
} }
func taskLoop(ctx context.Context, svc *service.Services, tasks []*tasks.Task, interfaces []tasks.Interface) error { func taskLoop(ctx context.Context, svc *service.Services, surveyTasks []*tasks.Task, interfaces []tasks.Interface) error {
interfaceIndex := rand.Int() % len(interfaces) interfaceIndex := rand.Int() % len(interfaces)
for _, task := range tasks { for _, task := range surveyTasks {
task.SetInterface(interfaces[interfaceIndex]) task.SetInterface(interfaces[interfaceIndex])