X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/1e2df788bbb17653a6df44acd41da2edb109d403..75b9579355e1adcdbb1255a7e8e4582e0a431f3d:/schedule.go?ds=inline 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()