Remove unused types.
This commit is contained in:
parent
af38aafeb5
commit
6805462d10
2 changed files with 7 additions and 254 deletions
|
|
@ -628,31 +628,16 @@ var int32Type = reflect.TypeOf(int32(1))
|
|||
var uint32Type = reflect.TypeOf(uint32(1))
|
||||
var int64Type = reflect.TypeOf(int64(1))
|
||||
var uint64Type = reflect.TypeOf(uint64(1))
|
||||
var float32Type = reflect.TypeOf(float32(1.1))
|
||||
var float64Type = reflect.TypeOf(float64(1.1))
|
||||
|
||||
var nullInt8Type = reflect.TypeOf(internal.NullInt8{})
|
||||
|
||||
//var nullUInt8Type = reflect.TypeOf(internal.NullUInt8{})
|
||||
var nullInt16Type = reflect.TypeOf(internal.NullInt16{})
|
||||
|
||||
//var nullUInt16Type = reflect.TypeOf(internal.NullUInt16{})
|
||||
var nullInt32Type = reflect.TypeOf(internal.NullInt32{})
|
||||
|
||||
//var nullUInt32Type = reflect.TypeOf(internal.NullUInt32{})
|
||||
var nullInt64Type = reflect.TypeOf(sql.NullInt64{})
|
||||
|
||||
//var nullUInt64Type = reflect.TypeOf(internal.NullUInt64{})
|
||||
|
||||
var nullFloat32Type = reflect.TypeOf(internal.NullFloat32{})
|
||||
var nullFloat64Type = reflect.TypeOf(sql.NullFloat64{})
|
||||
|
||||
var nullStringType = reflect.TypeOf(sql.NullString{})
|
||||
|
||||
var nullBoolType = reflect.TypeOf(sql.NullBool{})
|
||||
|
||||
var nullInt8Type = reflect.TypeOf(internal.NullInt8{})
|
||||
var nullInt16Type = reflect.TypeOf(internal.NullInt16{})
|
||||
var nullInt32Type = reflect.TypeOf(internal.NullInt32{})
|
||||
var nullInt64Type = reflect.TypeOf(sql.NullInt64{})
|
||||
var nullFloat32Type = reflect.TypeOf(internal.NullFloat32{})
|
||||
var nullFloat64Type = reflect.TypeOf(sql.NullFloat64{})
|
||||
var nullStringType = reflect.TypeOf(sql.NullString{})
|
||||
var nullTimeType = reflect.TypeOf(internal.NullTime{})
|
||||
|
||||
var nullByteArrayType = reflect.TypeOf(internal.NullByteArray{})
|
||||
|
||||
func newScanType(columnType *sql.ColumnType) reflect.Type {
|
||||
|
|
|
|||
|
|
@ -128,42 +128,6 @@ func (n NullInt8) Value() (driver.Value, error) {
|
|||
|
||||
//===============================================================//
|
||||
|
||||
// NullUInt8 struct
|
||||
type NullUInt8 struct {
|
||||
Uint8 uint8
|
||||
Valid bool
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (n *NullUInt8) Scan(value interface{}) error {
|
||||
|
||||
switch v := value.(type) {
|
||||
case uint8:
|
||||
n.Uint8, n.Valid = v, true
|
||||
return nil
|
||||
case []byte:
|
||||
intV, err := strconv.ParseInt(string(v), 10, 8)
|
||||
if err == nil {
|
||||
n.Uint8, n.Valid = uint8(intV), true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
n.Valid = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (n NullUInt8) Value() (driver.Value, error) {
|
||||
if !n.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return n.Uint8, nil
|
||||
}
|
||||
|
||||
//===============================================================//
|
||||
|
||||
// NullInt16 struct
|
||||
type NullInt16 struct {
|
||||
Int16 int16
|
||||
|
|
@ -209,48 +173,6 @@ func (n NullInt16) Value() (driver.Value, error) {
|
|||
|
||||
//===============================================================//
|
||||
|
||||
// NullUInt16 struct
|
||||
type NullUInt16 struct {
|
||||
UInt16 uint16
|
||||
Valid bool
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (n *NullUInt16) Scan(value interface{}) error {
|
||||
|
||||
switch v := value.(type) {
|
||||
case uint16:
|
||||
n.UInt16, n.Valid = v, true
|
||||
return nil
|
||||
case int8:
|
||||
n.UInt16, n.Valid = uint16(v), true
|
||||
return nil
|
||||
case uint8:
|
||||
n.UInt16, n.Valid = uint16(v), true
|
||||
return nil
|
||||
case []byte:
|
||||
intV, err := strconv.ParseInt(string(v), 10, 16)
|
||||
if err == nil {
|
||||
n.UInt16, n.Valid = uint16(intV), true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
n.Valid = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (n NullUInt16) Value() (driver.Value, error) {
|
||||
if !n.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return n.UInt16, nil
|
||||
}
|
||||
|
||||
//===============================================================//
|
||||
|
||||
// NullInt32 struct
|
||||
type NullInt32 struct {
|
||||
Int32 int32
|
||||
|
|
@ -302,160 +224,6 @@ func (n NullInt32) Value() (driver.Value, error) {
|
|||
|
||||
//===============================================================//
|
||||
|
||||
// NullInt32 struct
|
||||
type NullUInt32 struct {
|
||||
UInt32 uint32
|
||||
Valid bool
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (n *NullUInt32) Scan(value interface{}) error {
|
||||
|
||||
switch v := value.(type) {
|
||||
case uint32:
|
||||
n.UInt32, n.Valid = v, true
|
||||
return nil
|
||||
case int16:
|
||||
n.UInt32, n.Valid = uint32(v), true
|
||||
return nil
|
||||
case uint16:
|
||||
n.UInt32, n.Valid = uint32(v), true
|
||||
return nil
|
||||
case int8:
|
||||
n.UInt32, n.Valid = uint32(v), true
|
||||
return nil
|
||||
case uint8:
|
||||
n.UInt32, n.Valid = uint32(v), true
|
||||
return nil
|
||||
case []byte:
|
||||
intV, err := strconv.ParseInt(string(v), 10, 32)
|
||||
if err == nil {
|
||||
n.UInt32, n.Valid = uint32(intV), true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
n.Valid = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (n NullUInt32) Value() (driver.Value, error) {
|
||||
if !n.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return n.UInt32, nil
|
||||
}
|
||||
|
||||
//===============================================================//
|
||||
|
||||
// NullInt32 struct
|
||||
type NullInt64 struct {
|
||||
Int64 int64
|
||||
Valid bool
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (n *NullInt64) Scan(value interface{}) error {
|
||||
switch v := value.(type) {
|
||||
case int64:
|
||||
n.Int64, n.Valid = v, true
|
||||
return nil
|
||||
case int32:
|
||||
n.Int64, n.Valid = int64(v), true
|
||||
return nil
|
||||
case uint32:
|
||||
n.Int64, n.Valid = int64(v), true
|
||||
return nil
|
||||
case int16:
|
||||
n.Int64, n.Valid = int64(v), true
|
||||
return nil
|
||||
case uint16:
|
||||
n.Int64, n.Valid = int64(v), true
|
||||
return nil
|
||||
case int8:
|
||||
n.Int64, n.Valid = int64(v), true
|
||||
return nil
|
||||
case uint8:
|
||||
n.Int64, n.Valid = int64(v), true
|
||||
return nil
|
||||
case []byte:
|
||||
intV, err := strconv.ParseInt(string(v), 10, 32)
|
||||
if err == nil {
|
||||
n.Int64, n.Valid = int64(intV), true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
n.Valid = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (n NullInt64) Value() (driver.Value, error) {
|
||||
if !n.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return n.Int64, nil
|
||||
}
|
||||
|
||||
//===============================================================//
|
||||
|
||||
// NullInt32 struct
|
||||
type NullUInt64 struct {
|
||||
UInt64 uint64
|
||||
Valid bool
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (n *NullUInt64) Scan(value interface{}) error {
|
||||
switch v := value.(type) {
|
||||
case uint64:
|
||||
n.UInt64, n.Valid = v, true
|
||||
return nil
|
||||
case int32:
|
||||
n.UInt64, n.Valid = uint64(v), true
|
||||
return nil
|
||||
case uint32:
|
||||
n.UInt64, n.Valid = uint64(v), true
|
||||
return nil
|
||||
case int16:
|
||||
n.UInt64, n.Valid = uint64(v), true
|
||||
return nil
|
||||
case uint16:
|
||||
n.UInt64, n.Valid = uint64(v), true
|
||||
return nil
|
||||
case int8:
|
||||
n.UInt64, n.Valid = uint64(v), true
|
||||
return nil
|
||||
case uint8:
|
||||
n.UInt64, n.Valid = uint64(v), true
|
||||
return nil
|
||||
case []byte:
|
||||
intV, err := strconv.ParseInt(string(v), 10, 32)
|
||||
if err == nil {
|
||||
n.UInt64, n.Valid = uint64(intV), true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
n.Valid = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (n NullUInt64) Value() (driver.Value, error) {
|
||||
if !n.Valid {
|
||||
return nil, nil
|
||||
}
|
||||
return n.UInt64, nil
|
||||
}
|
||||
|
||||
//===============================================================//
|
||||
|
||||
// NullFloat32 struct
|
||||
type NullFloat32 struct {
|
||||
Float32 float32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue