new/null-types #2

Merged
jake merged 10 commits from new/null-types into main 2026-01-23 19:59:06 +00:00
Showing only changes of commit b4428e397e - Show all commits

13
lazy.go
View File

@@ -103,11 +103,14 @@ func RandomGenerate(m Config) (*Mock, error) {
nullType := false
switch field.Type {
case reflect.TypeOf(sql.NullTime{}):
// if isNull() {
rows[y] = append(rows[y], nil)
// } else {
// rows[y] = append(rows[y], time.Now())
// }
var temp sql.NullTime
if isNull() {
temp.Valid = false
} else {
temp.Valid = true
temp.Time = time.Now()
}
rows[y] = append(rows[y], temp)
nullType = true
case reflect.TypeOf(sql.NullInt16{}):
if isNull() {