This repository was archived by the owner on Aug 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ func (r *Row) WriteSlice(e interface{}, cols int) int {
5959 if cell .SetString (`` ); t .Valid {
6060 cell .SetValue (t .Int64 )
6161 }
62+ case sql.NullInt32 :
63+ cell := r .AddCell ()
64+ if cell .SetString (`` ); t .Valid {
65+ cell .SetValue (t .Int32 )
66+ }
6267 case sql.NullFloat64 :
6368 cell := r .AddCell ()
6469 if cell .SetString (`` ); t .Valid {
@@ -136,6 +141,11 @@ func (r *Row) WriteStruct(e interface{}, cols int) int {
136141 if cell .SetString (`` ); t .Valid {
137142 cell .SetValue (t .Int64 )
138143 }
144+ case sql.NullInt32 :
145+ cell := r .AddCell ()
146+ if cell .SetString (`` ); t .Valid {
147+ cell .SetValue (t .Int32 )
148+ }
139149 case sql.NullFloat64 :
140150 cell := r .AddCell ()
141151 if cell .SetString (`` ); t .Valid {
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ func TestWrite(t *testing.T) {
4242 Raiting sql.NullFloat64
4343 NullLastName sql.NullString
4444 NullHasPhd sql.NullBool
45- NullGithubStars sql.NullInt64
45+ NullGithubStars sql.NullInt32
4646 NullRaiting sql.NullFloat64
4747 }
4848 testStruct := e {
@@ -59,7 +59,7 @@ func TestWrite(t *testing.T) {
5959 sql.NullFloat64 {Float64 : 0.123 , Valid : true },
6060 sql.NullString {String : `What ever` , Valid : false },
6161 sql.NullBool {Bool : true , Valid : false },
62- sql.NullInt64 { Int64 : 100 , Valid : false },
62+ sql.NullInt32 { Int32 : 100 , Valid : false },
6363 sql.NullFloat64 {Float64 : 0.123 , Valid : false },
6464 }
6565 cnt := row .WriteStruct (& testStruct , - 1 )
You can’t perform that action at this time.
0 commit comments