From a83e9bd36fc6a934553d93cbcc0edb120321f971 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sun, 26 Apr 2020 00:23:49 +0200 Subject: Filtering from cache --- pkg/util/util.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkg/util') diff --git a/pkg/util/util.go b/pkg/util/util.go index c5472ab..659c886 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -1,5 +1,7 @@ package util +import "time" + func StrContains(haystack []string, needle string) bool { for _, s := range haystack { if s == needle { @@ -9,3 +11,11 @@ func StrContains(haystack []string, needle string) bool { return false } + +func TimeFormat(t time.Time) string { + if t.IsZero() { + return "not set" + } else { + return t.Format(time.ANSIC) + } +} -- cgit v1.2.3-54-g00ecf