Skip to content

Commit

Permalink
make sure Columns() work with row styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Charbonnel committed Aug 8, 2022
1 parent c8e5b9c commit dd1fb8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rows.go
Expand Up @@ -183,6 +183,8 @@ func (rows *Rows) Columns(opts ...Options) ([]string, error) {
case xml.EndElement:
if xmlElement.Name.Local == "sheetData" {
return rowIterator.columns, rowIterator.err
} else if xmlElement.Name.Local == "row" {
return rowIterator.columns, rowIterator.err
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions rows_test.go
Expand Up @@ -108,12 +108,15 @@ func TestRowsGetRowOpts(t *testing.T) {
require.NoError(t, err)

rows.Next()
rows.Columns()
got := rows.GetRowOpts()
assert.Equal(t, expectedRowStyleID1, got)
rows.Next()
rows.Columns()
got = rows.GetRowOpts()
assert.Equal(t, expectedRowStyleID2, got)
rows.Next()
rows.Columns()
got = rows.GetRowOpts()
assert.Equal(t, expectedRowStyleID3, got)
}
Expand Down

0 comments on commit dd1fb8b

Please sign in to comment.