code: func (dc *Datacenter) GetAllDatastores(ctx context.Context) (map[string]*DatastoreInfo, error) {
  	finder := getFinder(dc)
  	datastores, err := finder.DatastoreList(ctx, "*")
  	if err != nil {
  		klog.Errorf("Failed to get all the datastores. err: %+v", err)
  		return nil, err
  	}
  	var dsList []types.ManagedObjectReference
  	for _, ds := range datastores {
  		dsList = append(dsList, ds.Reference())
  	}
  
  	var dsMoList []mo.Datastore
  	pc := property.DefaultCollector(dc.Client())
  	properties := []string{DatastoreInfoProperty}
  	err = pc.Retrieve(ctx, dsList, properties, &dsMoList)
  	if err != nil {
  		klog.Errorf("Failed to get Datastore managed objects from datastore objects."+
  			" dsObjList: %+v, properties: %+v, err: %v", dsList, properties, err)
  		return nil, err
  	}
  
  	dsURLInfoMap := make(map[string]*DatastoreInfo)
  	for _, dsMo := range dsMoList {
  		dsURLInfoMap[dsMo.Info.GetDatastoreInfo().Url] = &DatastoreInfo{
  			&Datastore{object.NewDatastore(dc.Client(), dsMo.Reference()),
  				dc},
  			dsMo.Info.GetDatastoreInfo()}
  	}
  	klog.V(9).Infof("dsURLInfoMap : %+v", dsURLInfoMap)
  	return dsURLInfoMap, nil
  }
docs: // GetAllDatastores gets the datastore URL to DatastoreInfo map for all the datastores in
  // the datacenter.