diff options
Diffstat (limited to 'time.string.go')
| -rw-r--r-- | time.string.go | 11 |
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 } |
