code: func (m *memory) Sync() error {
  	var sets []*source.ChangeSet
  
  	m.Lock()
  
  	// read the source
  	var gerr []string
  
  	for _, source := range m.sources {
  		ch, err := source.Read()
  		if err != nil {
  			gerr = append(gerr, err.Error())
  			continue
  		}
  		sets = append(sets, ch)
  	}
  
  	// merge sets
  	set, err := m.opts.Reader.Merge(sets...)
  	if err != nil {
  		m.Unlock()
  		return err
  	}
  
  	// set values
  	vals, err := m.opts.Reader.Values(set)
  	if err != nil {
  		m.Unlock()
  		return err
  	}
  	m.vals = vals
  	m.snap = &loader.Snapshot{
  		ChangeSet: set,
  		Version:   fmt.Sprintf("%d", time.Now().Unix()),
  	}
  
  	m.Unlock()
  
  	// update watchers
  	m.update()
  
  	if len(gerr) > 0 {
  		return fmt.Errorf("source loading errors: %s", strings.Join(gerr, "\n"))
  	}
  
  	return nil
  }
docs: // Sync loads all the sources, calls the parser and updates the config