Browse Source

converter: Use strconv.FormatUint instead of fmt.Sprintf

Julien Schmidt 10 năm trước cách đây
mục cha
commit
d93467bf85
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      statement.go

+ 2 - 1
statement.go

@@ -12,6 +12,7 @@ import (
 	"database/sql/driver"
 	"fmt"
 	"reflect"
+	"strconv"
 )
 
 type mysqlStmt struct {
@@ -139,7 +140,7 @@ func (c converter) ConvertValue(v interface{}) (driver.Value, error) {
 	case reflect.Uint64:
 		u64 := rv.Uint()
 		if u64 >= 1<<63 {
-			return fmt.Sprintf("%d", u64), nil
+			return strconv.FormatUint(u64, 10), nil
 		}
 		return int64(u64), nil
 	case reflect.Float32, reflect.Float64: