new/null-types #2
5
lazy.go
5
lazy.go
@@ -114,7 +114,6 @@ func kindToRandom(field reflect.StructField) any {
|
|||||||
//manner. For now we check those types first, and will clean this up later.
|
//manner. For now we check those types first, and will clean this up later.
|
||||||
switch field.Type {
|
switch field.Type {
|
||||||
case reflect.TypeOf(sql.NullTime{}):
|
case reflect.TypeOf(sql.NullTime{}):
|
||||||
fmt.Println("found nulltime")
|
|
||||||
var temp sql.NullTime
|
var temp sql.NullTime
|
||||||
if !isNull() {
|
if !isNull() {
|
||||||
temp.Valid = true
|
temp.Valid = true
|
||||||
@@ -191,10 +190,8 @@ func kindToRandom(field reflect.StructField) any {
|
|||||||
case reflect.String:
|
case reflect.String:
|
||||||
return fmt.Sprintf("random %d", rand.Int())
|
return fmt.Sprintf("random %d", rand.Int())
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
fmt.Println("THIS TWO")
|
|
||||||
return rand.Int()%2 == 0
|
return rand.Int()%2 == 0
|
||||||
case reflect.TypeOf(time.Time{}).Kind():
|
case reflect.TypeOf(time.Time{}).Kind():
|
||||||
fmt.Println("THIS?")
|
|
||||||
return time.Now()
|
return time.Now()
|
||||||
case reflect.Array:
|
case reflect.Array:
|
||||||
underlying := field.Type.Elem().Kind()
|
underlying := field.Type.Elem().Kind()
|
||||||
@@ -280,7 +277,7 @@ func kindToRandom(field reflect.StructField) any {
|
|||||||
case reflect.String:
|
case reflect.String:
|
||||||
var strslice []string
|
var strslice []string
|
||||||
for x := 0; x < count; x++ {
|
for x := 0; x < count; x++ {
|
||||||
strslice = append(strslice, fmt.Sprintf("%d", rand.Int()))
|
strslice = append(strslice, fmt.Sprintf("random %d", rand.Int()))
|
||||||
}
|
}
|
||||||
return strslice
|
return strslice
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user