func (m *Monitor) Check() error {
	m.log.Infof("checking monitor for [%s]", m.RootDirectory)
	if m.Recursive {
		return filepath.Walk(m.RootDirectory, m.walkFunc)
	}

	files, err := ioutil.ReadDir(m.RootDirectory)
	if err != nil {
		return err
	}
	for _, info := range files {
		path := path.Join(m.RootDirectory, info.Name())
		if err := m.apply(path, info); err != nil {
			return err
		}
	}
	return nil
}
// Check recursively checks all file in the directory for the rules.
Check recursively checks all file in the directory for the rules.
// Check recursively checks all file in the directory for the rules .
func (m *Monitor) Check() error {
	m.log.Infof("checking monitor for [%s]", m.RootDirectory)
	if m.Recursive {
		return filepath.Walk(m.RootDirectory, m.walkFunc)
	}
	files, err := ioutil.ReadDir(m.RootDirectory)
	if err != nil {
		return err
	}
	for _, info := range files {
		path := path.Join(m.RootDirectory, info.Name())
		if err := m.apply(path, info); err != nil {
			return err
		}
	}
	return nil
}
func ( m * Monitor ) Check ( ) error { m . log . Infof ( " " , m . RootDirectory ) if m . Recursive { return filepath . Walk ( m . RootDirectory , m . walkFunc ) } files , err := ioutil . ReadDir ( m . RootDirectory ) if err != nil { return err } for _ , info := range files { path := path . Join ( m . RootDirectory , info . Name ( ) ) if err := m . apply ( path , info ) ; err != nil { return err } } return nil }
Check recursively checks all file in the directory for the rules.
Check recursively checks all file in the directory for the rules .