File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package task_logger
2
2
3
3
import (
4
4
"os/exec"
5
+ "strings"
5
6
"time"
6
7
)
7
8
@@ -20,6 +21,24 @@ const (
20
21
TaskFailStatus TaskStatus = "error"
21
22
)
22
23
24
+ func (s TaskStatus ) String () string {
25
+ switch s {
26
+ case TaskWaitingStatus ,
27
+ TaskStartingStatus ,
28
+ TaskWaitingConfirmation ,
29
+ TaskConfirmed ,
30
+ TaskRejected ,
31
+ TaskRunningStatus ,
32
+ TaskStoppingStatus ,
33
+ TaskStoppedStatus ,
34
+ TaskSuccessStatus ,
35
+ TaskFailStatus :
36
+ return string (s )
37
+ default :
38
+ return "unknown"
39
+ }
40
+ }
41
+
23
42
func (s TaskStatus ) IsValid () bool {
24
43
switch s {
25
44
case TaskWaitingStatus ,
@@ -57,7 +76,7 @@ func (s TaskStatus) Format() (res string) {
57
76
}
58
77
59
78
// to avoid email content injection issue
60
- // res += strings.ToUpper(string(s ))
79
+ res += strings .ToUpper (s . String ( ))
61
80
62
81
return
63
82
}
You can’t perform that action at this time.
0 commit comments