// parseStart parses a string into a periodicStart.
976446
func parseStart(start string) (*periodicStart, error) {
	ps := &periodicStart{}
	ps.dayOfWeek = -1
	f := strings.Fields(start)

	switch len(f) {
	case 1: // no day provided
	case 2:
		if dow, ok := weekdays[strings.ToLower(f[0])]; ok {
			ps.dayOfWeek = dow
		} else {
			return nil, fmt.Errorf("invalid day of week %q", f[0])
		}
		// shift
		f = f[1:]
	default:
		return nil, fmt.Errorf("wrong number of fields")
	}

	n, err := fmt.Sscanf(f[0], "%d:%d", &ps.hourOfDay, &ps.minuteOfHour)

	// check Sscanf failure
	if n != 2 || err != nil {
		return nil, fmt.Errorf("invalid time of day %q: %v", f[0], err)
	}

	// check hour range
	if ps.hourOfDay < 0 || ps.hourOfDay > 23 {
		return nil, fmt.Errorf("invalid time of day %q: hour must be >= 0 and <= 23", f[0])
	}

	// check minute range
	if ps.minuteOfHour < 0 || ps.minuteOfHour > 59 {
		return nil, fmt.Errorf("invalid time of day %q: minute must be >= 0 and <= 59", f[0])
	}

	return ps, nil
}
696157
func OnStart(config *service.Config) error {
	return service.Run(context.TODO(), *config, nil)
}
837799
func (g *Group) OnStart() error {
	g.ticker = time.NewTicker(g.groupCheckDuration)
	go g.processTicks()
	return nil
}
465694
func (t *Tree) startParse(funcs []map[string]interface{}, lex *lexer) {
	t.Root = nil
	t.lex = lex
	t.vars = []string{"$"}
	t.funcs = funcs
}
351271
func SoundStart(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "soundstart", Listener: listener}
}
202490
func (s *TimePeriod) SetStart(v time.Time) *TimePeriod {
	s.Start = &v
	return s
}
106171
func (w *Writer) SetStart(contentId string) error {
	cid, err := formatContentId(contentId)
	if err != nil {
		return err
	}

	w.start = cid
	return nil
}
878215
func nextStart(p *xml.Decoder) (xml.StartElement, error) {
	for {
		t, err := p.Token()
		if err != nil {
			log.Fatal("token", err)
		}
		switch t := t.(type) {
		case xml.StartElement:
			return t, nil
		}
	}
	panic("unreachable")
}
276000
func (s *Reservation) SetStart(v string) *Reservation {
	s.Start = &v
	return s
}
822665
func Startswith(expectedValue string) *startswithMatcher {
	matcher := new(startswithMatcher)
	matcher.expectedValue = expectedValue
	return matcher
}
86205
func ParsePeriodic(start, duration string) (*Periodic, error) {
	var err error

	pc := &Periodic{}

	if pc.start, err = parseStart(start); err != nil {
		return nil, fmt.Errorf("unable to parse start: %v", err)
	}

	if pc.duration, err = time.ParseDuration(duration); err != nil {
		return nil, fmt.Errorf("unable to parse duration: %v", err)
	}

	if pc.duration < time.Duration(0) {
		return nil, fmt.Errorf("duration cannot be negative")
	}

	// check that the duration of the window does not exceed the period.
	if (pc.start.dayOfWeek == -1 && pc.duration >= 24*time.Hour) || pc.duration >= 7*24*time.Hour {
		return nil, fmt.Errorf("duration cannot exceed period")
	}

	return pc, nil
}
921256
func (t *Tree) startParse(lex *lexer) {
	t.Root = nil
	t.lex = lex
}
317266
func (s *DateFilter) SetStart(v string) *DateFilter {
	s.Start = &v
	return s
}
398910
func BeforeStart(fn func() error) Option {
	return func(o *Options) {
		o.BeforeStart = append(o.BeforeStart, fn)
	}
}
979001
func startsWithInitialism(s string) string {
	var initialism string
	// the longest initialism is 5 char, the shortest 2
	for i := 1; i <= 5; i++ {
		if len(s) > i-1 && commonInitialisms[s[:i]] {
			initialism = s[:i]
		}
	}
	return initialism
}
530022
func (s *SearchInput) SetStart(v int64) *SearchInput {
	s.Start = &v
	return s
}
1286871
func (p *printer) writeStart(start *StartElement) error {
	if start.Name.Local == "" {
		return fmt.Errorf("xml: start tag with no name")
	}

	p.tags = append(p.tags, start.Name)
	p.markPrefix()

	p.writeIndent(1)
	p.WriteByte('<')
	p.WriteString(start.Name.Local)

	if start.Name.Space != "" {
		p.WriteString(` xmlns="`)
		p.EscapeString(start.Name.Space)
		p.WriteByte('"')
	}

	// Attributes
	for _, attr := range start.Attr {
		name := attr.Name
		if name.Local == "" {
			continue
		}
		p.WriteByte(' ')
		if name.Space != "" {
			p.WriteString(p.createAttrPrefix(name.Space))
			p.WriteByte(':')
		}
		p.WriteString(name.Local)
		p.WriteString(`="`)
		p.EscapeString(attr.Value)
		p.WriteByte('"')
	}
	p.WriteByte('>')
	return nil
}