summaryrefslogtreecommitdiff
path: root/timeutil
diff options
authorMaciej Borzecki <maciej.zenon.borzecki@canonical.com>2017-12-19 12:11:19 +0100
committerMaciej Borzecki <maciej.zenon.borzecki@canonical.com>2017-12-19 12:11:19 +0100
commitf144537687b8daea3865e3507d618e69d443e059 (patch)
treee0bf0d15eef89534d819f911976c6ea95b73dc87 /timeutil
parent0b363be8206e8e110b3b0b6cdbe8c5780ae88862 (diff)
timeutil: address review feedback (thanks @stolowski)
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Diffstat (limited to 'timeutil')
-rw-r--r--timeutil/schedule.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/timeutil/schedule.go b/timeutil/schedule.go
index 4e7da4712f..32f91f4c9c 100644
--- a/timeutil/schedule.go
+++ b/timeutil/schedule.go
@@ -68,7 +68,7 @@ func (t Clock) Time(base time.Time) time.Time {
}
// ParseClock parses a string that contains hour:minute and returns
-// an Clock type or an error
+// a Clock type or an error
func ParseClock(s string) (t Clock, err error) {
m := validTime.FindStringSubmatch(s)
if len(m) == 0 {
@@ -284,7 +284,7 @@ type ScheduleWindow struct {
// Includes returns whether t falls inside the window.
func (s ScheduleWindow) Includes(t time.Time) bool {
- return (t.Equal(s.Start) || t.After(s.Start)) && (t.Equal(s.End) || t.Before(s.End))
+ return !(t.Before(s.Start) || t.After(s.End))
}
// IsZero returns whether s is uninitialized.