From b4428e397e756be77bf5e946bba91ed99f0090e6 Mon Sep 17 00:00:00 2001 From: jake Date: Fri, 16 Jan 2026 10:31:40 -0500 Subject: [PATCH] using proper struct for nulltypes --- lazy.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lazy.go b/lazy.go index b3d2a37..7fe33ad 100644 --- a/lazy.go +++ b/lazy.go @@ -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() {