X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/d008b46cbfc6348255e9b9a1fc009f0e4bd6aa2a..8d9547f6e7ffa1e95ad25d9f8f2e7cfd23d992d0:/schedule.go diff --git a/schedule.go b/schedule.go index d27274b..f3dcfe2 100644 --- a/schedule.go +++ b/schedule.go @@ -209,6 +209,14 @@ func (s *Schedules) List() string { return strings.Join(lines, "\n") } +// Len returns the number of schedules. +func (s *Schedules) Len() int { + s.mutex.Lock() + defer s.mutex.Unlock() + + return len(s.file.Schedules) +} + // Remove removes the schedule id and returns the answer of the tool. func (s *Schedules) Remove(id int) (string, error) { s.mutex.Lock()