Remove unused types.

This commit is contained in:
go-jet 2019-08-08 18:30:11 +02:00
parent af38aafeb5
commit 6805462d10
2 changed files with 7 additions and 254 deletions

View file

@ -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