Skip to content

Commit 18262fb

Browse files
committed
fix comment
1 parent 532d05d commit 18262fb

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Hajime Nakagami <nakagami at gmail.com>
3434
Hanno Braun <mail at hannobraun.com>
3535
Henri Yandell <flamefew at gmail.com>
3636
Hirotaka Yamamoto <ymmt2005 at gmail.com>
37+
Huyiguang <[email protected]>
3738
ICHINOSE Shogo <shogo82148 at gmail.com>
3839
INADA Naoki <songofacandy at gmail.com>
3940
Jacek Szwec <szwec.jacek at gmail.com>

statement.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,8 @@ func (c converter) ConvertValue(v interface{}) (driver.Value, error) {
163163
}
164164
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
165165
return rv.Int(), nil
166-
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32:
167-
return int64(rv.Uint()), nil
168-
case reflect.Uint64:
169-
u64 := rv.Uint()
170-
if u64 >= 1<<63 {
171-
return u64, nil
172-
}
173-
return int64(u64), nil
166+
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
167+
return rv.Uint(), nil
174168
case reflect.Float32, reflect.Float64:
175169
return rv.Float(), nil
176170
case reflect.Bool:

statement_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func TestConvertUnsignedIntegers(t *testing.T) {
110110
t.Fatalf("%T type not convertible %s", value, err)
111111
}
112112

113-
if output != int64(42) {
113+
if output != uint64(42) {
114114
t.Fatalf("%T type not converted, got %#v %T", value, output, output)
115115
}
116116
}

0 commit comments

Comments
 (0)