aboutsummaryrefslogtreecommitdiff
path: root/pkg/util/util.go
blob: 88d04c040cd0419e4f8743e6c24781180adc7c45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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 {
			return true
		}
	}

	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"
	}

	return t.Format(time.ANSIC)
}
/gui/gtk/windows.py?h=v0.14.1&id=a54998f99c9bc5830eba7de9a76fac10f99721f0&follow=1'>showed masked packages unmasked by the user similar to stable marked testing ...necoro5-13/+40 2007-03-31changed changelognecoro1-1/+2 2007-03-31Some small changes for etcproposals 1.1necoro1-2/+2 2007-03-31Some small changes for etcproposals 1.1necoro2-3/+3 2007-03-31Some small changes for etcproposals 1.1necoro1-6/+13 2007-03-31Allowed Plugins to have a menunecoro7-201/+315 2007-03-15Added etc-proposals pluginnecoro7-28/+121 2007-03-10Added USE_EXPAND-supportnecoro5-11/+63 2007-03-10Added plugin-data to about-dialognecoro3-197/+264