Skip to content

Commit

Permalink
test: backport to go1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Oct 26, 2024
1 parent fbd4dfc commit 1023392
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions sentrysql/fakedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1258,33 +1258,33 @@ func converterForType(typ string) driver.ValueConverter {
func colTypeToReflectType(typ string) reflect.Type {
switch typ {
case "bool":
return reflect.TypeFor[bool]()
return reflect.TypeOf(false)
case "nullbool":
return reflect.TypeFor[sql.NullBool]()
return reflect.TypeOf(sql.NullBool{})
case "int16":
return reflect.TypeFor[int16]()
return reflect.TypeOf(int16(0))
case "nullint16":
return reflect.TypeFor[sql.NullInt16]()
return reflect.TypeOf(sql.NullInt16{})
case "int32":
return reflect.TypeFor[int32]()
return reflect.TypeOf(int32(0))
case "nullint32":
return reflect.TypeFor[sql.NullInt32]()
return reflect.TypeOf(sql.NullInt32{})
case "string":
return reflect.TypeFor[string]()
return reflect.TypeOf("")
case "nullstring":
return reflect.TypeFor[sql.NullString]()
return reflect.TypeOf(sql.NullString{})
case "int64":
return reflect.TypeFor[int64]()
return reflect.TypeOf(int64(0))
case "nullint64":
return reflect.TypeFor[sql.NullInt64]()
return reflect.TypeOf(sql.NullInt64{})
case "float64":
return reflect.TypeFor[float64]()
return reflect.TypeOf(float64(0))
case "nullfloat64":
return reflect.TypeFor[sql.NullFloat64]()
return reflect.TypeOf(sql.NullFloat64{})
case "datetime":
return reflect.TypeFor[time.Time]()
return reflect.TypeOf(time.Time{})
case "any":
return reflect.TypeFor[any]()
return reflect.TypeOf(new(any)).Elem()
}
panic("invalid fakedb column type of " + typ)
}

0 comments on commit 1023392

Please sign in to comment.