code: func (dc *Datacenter) createFolders() {
  	folders := []struct {
  		ref   *types.ManagedObjectReference
  		name  string
  		types []string
  	}{
  		{&dc.VmFolder, "vm", []string{"VirtualMachine", "VirtualApp", "Folder"}},
  		{&dc.HostFolder, "host", []string{"ComputeResource", "Folder"}},
  		{&dc.DatastoreFolder, "datastore", []string{"Datastore", "StoragePod", "Folder"}},
  		{&dc.NetworkFolder, "network", []string{"Network", "DistributedVirtualSwitch", "Folder"}},
  	}
  
  	for _, f := range folders {
  		folder := &Folder{}
  		folder.Name = f.name
  
  		if dc.isESX {
  			folder.ChildType = f.types[:1]
  			folder.Self = *f.ref
  			Map.PutEntity(dc, folder)
  		} else {
  			folder.ChildType = f.types
  			e := Map.PutEntity(dc, folder)
  
  			// propagate the generated morefs to Datacenter
  			ref := e.Reference()
  			f.ref.Type = ref.Type
  			f.ref.Value = ref.Value
  		}
  	}
  
  	net := Map.Get(dc.NetworkFolder).(*Folder)
  
  	for _, ref := range esx.Datacenter.Network {
  		// Add VM Network by default to each Datacenter
  		network := &mo.Network{}
  		network.Self = ref
  		network.Name = strings.Split(ref.Value, "-")[1]
  		network.Entity().Name = network.Name
  		if !dc.isESX {
  			network.Self.Value = "" // we want a different moid per-DC
  		}
  
  		net.putChild(network)
  	}
  }
docs: // Create Datacenter Folders.
  // Every Datacenter has 4 inventory Folders: Vm, Host, Datastore and Network.
  // The ESX folder child types are limited to 1 type.
  // The VC folders have additional child types, including nested folders.