Skip to content

Commit 8833ad6

Browse files
committed
fix golangci lint
1 parent 297e68e commit 8833ad6

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

.erda/migrations/cmdb/20211214-issue-state-circulation.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE `dice_issue_state_circulation`
22
(
33
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
44
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '表记录创建时间',
5-
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '表记录更新时间',
5+
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '表记录更新时间',
66
`project_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属项目 ID',
77
`state_from` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新前状态',
88
`state_to` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新后状态',

modules/dop/component-protocol/components/requirement-task-overview/stackChartBlock/stackChart/render.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ func (f *StackChart) setProps() {
6060
f.Type = "Chart"
6161
series := make([]Series, 0, len(f.States))
6262
for _, v := range f.States {
63-
data := make([]int, 0)
64-
for _, date := range f.Dates {
65-
data = append(data, f.DateMap[date][v.ID])
66-
}
6763
series = append(series, Series{
6864
Data: func() []int {
6965
array := make([]int, 0)
@@ -165,10 +161,10 @@ func (f *StackChart) setDateMap() {
165161
continue
166162
}
167163
if _, ok := dateMap[f.Dates[0]][v.StateFrom]; ok && v.StateFrom != 0 {
168-
baseCount[v.StateFrom] --
164+
baseCount[v.StateFrom] -= 1
169165
}
170166
if _, ok := dateMap[f.Dates[0]][v.StateTo]; ok {
171-
baseCount[v.StateTo] ++
167+
baseCount[v.StateTo] += 1
172168
}
173169

174170
}
@@ -181,10 +177,10 @@ func (f *StackChart) setDateMap() {
181177
continue
182178
}
183179
if _, ok3 := dateMap[f.Dates[i]][v.StateFrom]; ok3 && v.StateFrom != 0 {
184-
baseCount[v.StateFrom] --
180+
baseCount[v.StateFrom] -= 1
185181
}
186182
if _, ok3 := dateMap[f.Dates[i]][v.StateTo]; ok3 {
187-
baseCount[v.StateTo] ++
183+
baseCount[v.StateTo] += 1
188184
}
189185
}
190186
}

modules/dop/component-protocol/components/requirement-task-overview/stackChartBlock/stackChartFilter/model.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type State struct {
3636
}
3737

3838
type Values struct {
39-
Type string `json:"type"`
39+
Type string `json:"type"`
4040
}
4141

4242
const OperationKeyFilter filter.OperationKey = "filter"

modules/dop/component-protocol/components/requirement-task-overview/stackChartBlock/stackChartFilter/render.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ func (f *Filter) Render(ctx context.Context, c *cptype.Component, scenario cptyp
8989
h.SetStackChartType(f.State.Values.Type)
9090

9191
return f.SetToProtocolComponent(c)
92-
}
92+
}

0 commit comments

Comments
 (0)