From 79a3624058f61c04e91343c60cca5090da4ea486 Mon Sep 17 00:00:00 2001 From: sfwn Date: Tue, 10 Oct 2023 18:02:21 +0800 Subject: [PATCH] remove useless code --- .../issueexcel/sheets/sheet_issue/import.go | 10 +++++----- .../issue/core/query/issueexcel/vars/util.go | 19 ------------------- pkg/excel/decode.go | 1 - 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/internal/apps/dop/providers/issue/core/query/issueexcel/sheets/sheet_issue/import.go b/internal/apps/dop/providers/issue/core/query/issueexcel/sheets/sheet_issue/import.go index c1791f61c63..61b5306a347 100644 --- a/internal/apps/dop/providers/issue/core/query/issueexcel/sheets/sheet_issue/import.go +++ b/internal/apps/dop/providers/issue/core/query/issueexcel/sheets/sheet_issue/import.go @@ -180,15 +180,15 @@ func decodeMapToIssueSheetModel(data *vars.DataForFulfill, m map[IssueSheetColum case fieldAssigneeName: model.Common.AssigneeName = cell.Value case fieldCreatedAt: - model.Common.CreatedAt = vars.MustParseStringTime(cell.Value, groupField) + model.Common.CreatedAt = mustParseStringTime(cell.Value, groupField) case fieldPlanStartedAt: - model.Common.PlanStartedAt = vars.MustParseStringTime(cell.Value, groupField) + model.Common.PlanStartedAt = mustParseStringTime(cell.Value, groupField) case fieldPlanFinishedAt: - model.Common.PlanFinishedAt = vars.MustParseStringTime(cell.Value, groupField) + model.Common.PlanFinishedAt = mustParseStringTime(cell.Value, groupField) case fieldStartAt: - model.Common.StartAt = vars.MustParseStringTime(cell.Value, groupField) + model.Common.StartAt = mustParseStringTime(cell.Value, groupField) case fieldFinishAt: - model.Common.FinishAt = vars.MustParseStringTime(cell.Value, groupField) + model.Common.FinishAt = mustParseStringTime(cell.Value, groupField) case fieldEstimateTime: model.Common.EstimateTime = cell.Value case fieldLabels: diff --git a/internal/apps/dop/providers/issue/core/query/issueexcel/vars/util.go b/internal/apps/dop/providers/issue/core/query/issueexcel/vars/util.go index 19cb84160e4..53f6762f964 100644 --- a/internal/apps/dop/providers/issue/core/query/issueexcel/vars/util.go +++ b/internal/apps/dop/providers/issue/core/query/issueexcel/vars/util.go @@ -26,25 +26,6 @@ import ( "github.com/erda-project/erda/pkg/strutil" ) -func ParseStringTime(s string) (*time.Time, error) { - if s == "" { - return nil, nil - } - t, err := time.ParseInLocation("2006-01-02 15:04:05", s, time.Local) - if err != nil { - return nil, err - } - return &t, nil -} - -func MustParseStringTime(s string, typ string) *time.Time { - t, err := ParseStringTime(s) - if err != nil { - panic(fmt.Sprintf("invalid %s time: %s, err: %v", typ, s, err)) - } - return t -} - func ParseStringSliceByComma(s string) []string { results := strutil.Splits(s, []string{",", ","}, true) // trim space diff --git a/pkg/excel/decode.go b/pkg/excel/decode.go index 07ac3c541cb..e1db3218d9a 100644 --- a/pkg/excel/decode.go +++ b/pkg/excel/decode.go @@ -69,7 +69,6 @@ func DecodeToSheets(r io.Reader) (DecodedFile, error) { }) s := NewSheet(sheet) - //s.UnmergedSlice = fileUnmergedSlice[i] sheets.L = append(sheets.L, s) sheets.M[sheet.Name] = s