Skip to content

Commit

Permalink
add missing error check in SetSheetRow()
Browse files Browse the repository at this point in the history
  • Loading branch information
mqy committed Aug 19, 2019
1 parent 3092ce6 commit 64809db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,14 @@ func (f *File) SetSheetRow(sheet, axis string, slice interface{}) error {

for i := 0; i < v.Len(); i++ {
cell, err := CoordinatesToCellName(col+i, row)
// Error should never happens here. But keep ckecking to early detect regresions
// if it will be introduced in furure
// Error should never happens here. But keep checking to early detect regresions
// if it will be introduced in future.
if err != nil {
return err
}
f.SetCellValue(sheet, cell, v.Index(i).Interface())
if err := f.SetCellValue(sheet, cell, v.Index(i).Interface()); err != nil {
return err
}
}
return err
}
Expand Down

0 comments on commit 64809db

Please sign in to comment.