code: func (detacher *photonPersistentDiskDetacher) Detach(volumeName string, nodeName types.NodeName) error {
  
  	hostName := string(nodeName)
  	pdID := volumeName
  	attached, err := detacher.photonDisks.DiskIsAttached(context.TODO(), pdID, nodeName)
  	if err != nil {
  		// Log error and continue with detach
  		klog.Errorf(
  			"Error checking if persistent disk (%q) is already attached to current node (%q). Will continue and try detach anyway. err=%v",
  			pdID, hostName, err)
  	}
  
  	if err == nil && !attached {
  		// Volume is already detached from node.
  		klog.V(4).Infof("detach operation was successful. persistent disk %q is already detached from node %q.", pdID, hostName)
  		return nil
  	}
  
  	if err := detacher.photonDisks.DetachDisk(context.TODO(), pdID, nodeName); err != nil {
  		klog.Errorf("Error detaching volume %q: %v", pdID, err)
  		return err
  	}
  	return nil
  }
docs: // Detach the given device from the given host.