summaryrefslogtreecommitdiff
path: root/time.string.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-14 04:11:16 -0500
committerJeff Carr <[email protected]>2025-10-14 04:11:16 -0500
commita63a82e78a047c8dde14f106117b3ce88f209775 (patch)
treecadd3302dfb17816c496fbfc78744d8e5bcc21d8 /time.string.go
parentdeefa630ab2f566d7ad9ee5fc04769d58a8f4c23 (diff)
easier to track by allowing nil
Diffstat (limited to 'time.string.go')
-rw-r--r--time.string.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/time.string.go b/time.string.go
index 5dae2c0..595fb4f 100644
--- a/time.string.go
+++ b/time.string.go
@@ -7,21 +7,20 @@ import (
"time"
)
-func doTimeString(BUILDTIME string) (time.Time, error) {
- var t time.Time
+func doTimeString(BUILDTIME string) (*time.Time, error) {
parts := strings.Split(BUILDTIME, ".")
if len(parts) == 1 {
// The input epoch seconds
// epochSeconds := int64(1758646486)
num, err := strconv.Atoi(BUILDTIME)
if err != nil {
- return t, err
+ return nil, err
}
epochSeconds := int64(num)
// Convert the epoch seconds to a time.Time object.
// time.Unix() creates the time in the UTC timezone by default.
- t = time.Unix(epochSeconds, 0)
- return t, errors.New("treated string as seconds")
+ t := time.Unix(epochSeconds, 0)
+ return &t, errors.New("treated string as seconds")
}
- return t, NewFeature
+ return nil, NewFeature
}