mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-21 19:38:49 +00:00
feat: Refactor step status checking from if-else to switch statement in GetStepSuccessRate
- Replace if-else chain with switch statement for step.Status evaluation in monitor.go - Maintain completed and failed case handling with cleaner control flow
This commit is contained in:
@@ -121,9 +121,10 @@ func (m *OnboardingMonitor) GetStepSuccessRate() map[string]float64 {
|
|||||||
stepStats[step.Name] = map[string]int{"completed": 0, "failed": 0, "total": 0}
|
stepStats[step.Name] = map[string]int{"completed": 0, "failed": 0, "total": 0}
|
||||||
}
|
}
|
||||||
stepStats[step.Name]["total"]++
|
stepStats[step.Name]["total"]++
|
||||||
if step.Status == "completed" {
|
switch step.Status {
|
||||||
|
case "completed":
|
||||||
stepStats[step.Name]["completed"]++
|
stepStats[step.Name]["completed"]++
|
||||||
} else if step.Status == "failed" {
|
case "failed":
|
||||||
stepStats[step.Name]["failed"]++
|
stepStats[step.Name]["failed"]++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user