Skip to content

Commit

Permalink
Merge pull request #782 from WKBae/setvalue-bool
Browse files Browse the repository at this point in the history
Support bool type values on Cell.SetValue()
  • Loading branch information
tealeg authored Oct 24, 2023
2 parents 2f3ecd9 + c716103 commit cab4e03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ func (c *Cell) SetValue(n interface{}) {
switch t := n.(type) {
case time.Time:
c.SetDateTime(t)
return
case int, int8, int16, int32, int64:
c.SetNumeric(fmt.Sprintf("%d", n))
case float64:
Expand All @@ -412,6 +411,8 @@ func (c *Cell) SetValue(n interface{}) {
c.SetString(t)
case []byte:
c.SetString(string(t))
case bool:
c.SetBool(t)
case nil:
c.SetString("")
default:
Expand Down

0 comments on commit cab4e03

Please sign in to comment.