Skip to content

Commit

Permalink
Merge pull request #770 from enijns/master
Browse files Browse the repository at this point in the history
WriteStruct and WriteSlice no longer ignore sql.NullTime values
  • Loading branch information
tealeg authored Aug 18, 2023
2 parents 70241a1 + 41ff950 commit c8a49a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions write.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ func (r *Row) WriteSlice(e interface{}, cols int) int {
if cell.SetString(``); t.Valid {
cell.SetValue(t.String)
}
case sql.NullTime:
cell := r.AddCell()
if cell.SetString(``); t.Valid {
cell.SetValue(t.Time)
}
case sql.NullBool:
cell := r.AddCell()
if cell.SetString(``); t.Valid {
Expand Down Expand Up @@ -116,6 +121,11 @@ func (r *Row) WriteStruct(e interface{}, cols int) int {
if cell.SetString(``); t.Valid {
cell.SetValue(t.String)
}
case sql.NullTime:
cell := r.AddCell()
if cell.SetString(``); t.Valid {
cell.SetValue(t.Time)
}
case sql.NullBool:
cell := r.AddCell()
if cell.SetString(``); t.Valid {
Expand Down

0 comments on commit c8a49a6

Please sign in to comment.