From 701893ebbdb6f5df1c0c78f809fcea0b3ab89846 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Mon, 17 May 2021 10:59:09 -0700 Subject: [PATCH] Properly return the zero time for invalid timestamps --- helpers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers.go b/helpers.go index 3b16ff0..93ec01f 100644 --- a/helpers.go +++ b/helpers.go @@ -15,11 +15,11 @@ func GetStartTime(ctx context.Context, unit string, opts Options) (time.Time, er value, err := Show(ctx, unit, properties.ExecMainStartTimestamp, opts) if err != nil { - return time.Unix(0, 0), err + return time.Time{}, err } // ExecMainStartTimestamp returns an empty string if the unit is not running if value == "" { - return time.Unix(0, 0), ErrUnitNotActive + return time.Time{}, ErrUnitNotActive } return time.Parse(dateFormat, value) }