code: func ListPlugins(dockerCli command.Cli, rootcmd *cobra.Command) ([]Plugin, error) {
  	pluginDirs, err := getPluginDirs(dockerCli)
  	if err != nil {
  		return nil, err
  	}
  
  	candidates, err := listPluginCandidates(pluginDirs)
  	if err != nil {
  		return nil, err
  	}
  
  	var plugins []Plugin
  	for _, paths := range candidates {
  		if len(paths) == 0 {
  			continue
  		}
  		c := &candidate{paths[0]}
  		p, err := newPlugin(c, rootcmd)
  		if err != nil {
  			return nil, err
  		}
  		p.ShadowedPaths = paths[1:]
  		plugins = append(plugins, p)
  	}
  
  	return plugins, nil
  }
docs: // ListPlugins produces a list of the plugins available on the system