code: func (m *Meta) pluginDirs(includeAutoInstalled bool) []string {
  	// user defined paths take precedence
  	if len(m.pluginPath) > 0 {
  		return m.pluginPath
  	}
  
  	// When searching the following directories, earlier entries get precedence
  	// if the same plugin version is found twice, but newer versions will
  	// always get preference below regardless of where they are coming from.
  	// TODO: Add auto-install dir, default vendor dir and optional override
  	// vendor dir(s).
  	dirs := []string{"."}
  
  	// Look in the same directory as the Terraform executable.
  	// If found, this replaces what we found in the config path.
  	exePath, err := osext.Executable()
  	if err != nil {
  		log.Printf("[ERROR] Error discovering exe directory: %s", err)
  	} else {
  		dirs = append(dirs, filepath.Dir(exePath))
  	}
  
  	// add the user vendor directory
  	dirs = append(dirs, DefaultPluginVendorDir)
  
  	if includeAutoInstalled {
  		dirs = append(dirs, m.pluginDir())
  	}
  	dirs = append(dirs, m.GlobalPluginDirs...)
  
  	return dirs
  }
docs: // pluginDirs return a list of directories to search for plugins.
  //
  // Earlier entries in this slice get priority over later when multiple copies
  // of the same plugin version are found, but newer versions always override
  // older versions where both satisfy the provider version constraints.