aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 17:31:33 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 17:31:33 +0200
commit835d5f3547f10ede1997a938d9278a506a089bb7 (patch)
tree8bf73e9a068d1ebacc2fe8888e708dd7ac7ae0c1 /pkg
parent7ed48c710d1c95b74d3da60d55a4c30a30400617 (diff)
downloadfeed2imap-go-835d5f3547f10ede1997a938d9278a506a089bb7.tar.gz
feed2imap-go-835d5f3547f10ede1997a938d9278a506a089bb7.tar.bz2
feed2imap-go-835d5f3547f10ede1997a938d9278a506a089bb7.zip
Some linting remarks
Diffstat (limited to 'pkg')
-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)
}