rentease/internal/calendar/option.go

18 lines
362 B
Go

package calendar
import (
"fmt"
)
type Option func(*Service) error
func WithCalendar(key string, calendarId string) Option {
return func(s *Service) error {
_, err := s.CalendarList.Get(calendarId).Do()
if err != nil {
return fmt.Errorf("cannot find calendar entry with id %q: %w", calendarId, err)
}
s.calIds[key] = calendarId
return nil
}
}