code: func LoadDir(root string) (*Config, error) {
  	files, overrides, err := dirFiles(root)
  	if err != nil {
  		return nil, err
  	}
  	if len(files) == 0 && len(overrides) == 0 {
  		return nil, &ErrNoConfigsFound{Dir: root}
  	}
  
  	// Determine the absolute path to the directory.
  	rootAbs, err := filepath.Abs(root)
  	if err != nil {
  		return nil, err
  	}
  
  	var result *Config
  
  	// Sort the files and overrides so we have a deterministic order
  	sort.Strings(files)
  	sort.Strings(overrides)
  
  	// Load all the regular files, append them to each other.
  	for _, f := range files {
  		c, err := LoadFile(f)
  		if err != nil {
  			return nil, err
  		}
  
  		if result != nil {
  			result, err = Append(result, c)
  			if err != nil {
  				return nil, err
  			}
  		} else {
  			result = c
  		}
  	}
  	if len(files) == 0 {
  		result = &Config{}
  	}
  
  	// Load all the overrides, and merge them into the config
  	for _, f := range overrides {
  		c, err := LoadFile(f)
  		if err != nil {
  			return nil, err
  		}
  
  		result, err = Merge(result, c)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	// Mark the directory
  	result.Dir = rootAbs
  
  	return result, nil
  }
docs: // LoadDir loads all the Terraform configuration files in a single
  // directory and appends them together.
  //
  // Special files known as "override files" can also be present, which
  // are merged into the loaded configuration. That is, the non-override
  // files are loaded first to create the configuration. Then, the overrides
  // are merged into the configuration to create the final configuration.
  //
  // Files are loaded in lexical order.