aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pkg/util/util.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/util/util.go b/pkg/util/util.go
index 659c886..88d04c0 100644
--- a/pkg/util/util.go
+++ b/pkg/util/util.go
@@ -2,6 +2,7 @@ package util
import "time"
+// StrContains searches for `needle` in `haystack` and returns `true` if found.
func StrContains(haystack []string, needle string) bool {
for _, s := range haystack {
if s == needle {
@@ -12,10 +13,11 @@ func StrContains(haystack []string, needle string) bool {
return false
}
+// TimeFormat formats the given time, where an empty time is formatted as "not set".
func TimeFormat(t time.Time) string {
if t.IsZero() {
return "not set"
- } else {
- return t.Format(time.ANSIC)
}
+
+ return t.Format(time.ANSIC)
}
commit/CHANGELOG.md?h=v0.2.0&id=7197e2880981cd4205485cc8724d741948df60de&follow=1'>update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12