code: func (f *Folder) update(o mo.Reference, u func(mo.Reference, *[]types.ManagedObjectReference, types.ManagedObjectReference)) {
  	ref := o.Reference()
  
  	if f.Parent == nil {
  		return // this is the root folder
  	}
  
  	switch ref.Type {
  	case "Datacenter", "Folder":
  		return // nothing to update
  	}
  
  	dc := Map.getEntityDatacenter(f)
  
  	switch ref.Type {
  	case "Network", "DistributedVirtualSwitch", "DistributedVirtualPortgroup":
  		u(dc, &dc.Network, ref)
  	case "Datastore":
  		u(dc, &dc.Datastore, ref)
  	}
  }
docs: // update references when objects are added/removed from a Folder