From e3cc28bace09504308c300f3883cb52568eb5ed8 Mon Sep 17 00:00:00 2001 From: Dan Fuhry Date: Wed, 3 Jun 2026 00:52:53 -0400 Subject: [PATCH] [constants] add BuildTimestampTime --- constants/BUILD.bazel | 5 ++++- constants/helpers.go | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 constants/helpers.go diff --git a/constants/BUILD.bazel b/constants/BUILD.bazel index b9a36a7..e61ae48 100644 --- a/constants/BUILD.bazel +++ b/constants/BUILD.bazel @@ -15,7 +15,10 @@ genrule( go_multi_library( name = "constants", - srcs = ["constants.go"], + srcs = [ + "constants.go", + "helpers.go", + ], importpath = "go.fuhry.dev/runtime/constants", visibility = ["//visibility:public"], ) diff --git a/constants/helpers.go b/constants/helpers.go new file mode 100644 index 0000000..0ecb003 --- /dev/null +++ b/constants/helpers.go @@ -0,0 +1,14 @@ +package constants + +import ( + "strconv" + "time" +) + +func BuildTimestampTime() time.Time { + ts, err := strconv.ParseInt(BuildTimestamp, 10, 64) + if err != nil { + panic(err) + } + return time.Unix(ts, 0) +} -- 2.52.0