Priority returns a numeric ordering used to prevent stale callbacks from regressing a step's status. Higher values win over lower ones.
()
| 48 | // Priority returns a numeric ordering used to prevent stale callbacks |
| 49 | // from regressing a step's status. Higher values win over lower ones. |
| 50 | func (s Status) Priority() int { |
| 51 | switch s { |
| 52 | case StatusInProgress: |
| 53 | return 0 |
| 54 | case StatusInterrupted: |
| 55 | return 1 |
| 56 | case StatusError: |
| 57 | return 2 |
| 58 | case StatusCompleted: |
| 59 | return 3 |
| 60 | default: |
| 61 | return 0 |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // AllStatuses contains every Status value. Update this when |
| 66 | // adding new constants above. |
no outgoing calls
no test coverage detected