File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,13 @@ import (
10
10
11
11
// 任务检查信息
12
12
type TaskInfo struct {
13
- AppName string `json:"app_name"`
14
- Size int64 `json:"size"`
15
- StartTime string `json:"start_time"`
16
- EndTime string `json:"end_time"`
17
- CostTime float64 `json:"cost_time"`
18
- Error error `json:"error,omitempty"`
13
+ AppName string `json:"app_name"`
14
+ Size int64 `json:"size"`
15
+ StartTime string `json:"start_time"`
16
+ EndTime string `json:"end_time"`
17
+ CostTime float64 `json:"cost_time"`
18
+ Error error `json:"-"`
19
+ ErrorString string `json:"error,omitempty"`
19
20
}
20
21
21
22
// format 按照输出内容格式化(不可逆)
Original file line number Diff line number Diff line change 9
9
// Json 获取json格式报告数据
10
10
func Json (dep * model.DepTree , taskInfo TaskInfo ) []byte {
11
11
format (dep )
12
+ if taskInfo .Error != nil {
13
+ taskInfo .ErrorString = taskInfo .Error .Error ()
14
+ }
12
15
if data , err := json .Marshal (struct {
13
16
* model.DepTree
14
17
TaskInfo TaskInfo `json:"task_info"`
You can’t perform that action at this time.
0 commit comments