@@ -24,14 +24,18 @@ func IssuesToExcel(ctx *context.Context, issues issues_model.IssueList) *exceliz
2424 log .Error ("cannot get first cell: %v" , err )
2525 return f
2626 }
27- sw .SetRow (cell , []interface {}{
27+ err := sw .SetRow (cell , []interface {}{
2828 excelize.Cell {Value : "ID" },
2929 excelize.Cell {Value : "Title" },
3030 excelize.Cell {Value : "Status" },
3131 excelize.Cell {Value : "Assignee(s)" },
3232 excelize.Cell {Value : "Label(s)" },
3333 excelize.Cell {Value : "Created At" },
3434 })
35+ if err != nil {
36+ log .Error ("cannot SetRow for header: %v" , err )
37+ return f
38+ }
3539
3640 // built-in format ID 22 ("m/d/yy h:mm")
3741 datetimeStyleID , err := f .NewStyle (& excelize.Style {NumFmt : 22 })
@@ -70,14 +74,18 @@ func IssuesToExcel(ctx *context.Context, issues issues_model.IssueList) *exceliz
7074 }
7175
7276 cell , _ := excelize .CoordinatesToCellName (1 , i + 1 )
73- sw .SetRow (cell , []interface {}{
77+ err := sw .SetRow (cell , []interface {}{
7478 excelize.Cell {Value : issue .Index },
7579 excelize.Cell {Value : issue .Title },
7680 excelize.Cell {Value : issue .State ()},
7781 excelize.Cell {Value : assignees },
7882 excelize.Cell {Value : labels },
7983 excelize.Cell {StyleID : datetimeStyleID , Value : issue .CreatedUnix .AsTime ()},
8084 })
85+ if err != nil {
86+ log .Error ("cannot SetRow: %v" , err )
87+ return f
88+ }
8189
8290 }
8391
0 commit comments