code: func (detacher *gcePersistentDiskDetacher) Detach(volumeName string, nodeName types.NodeName) error {
  	pdName := path.Base(volumeName)
  
  	attached, err := detacher.gceDisks.DiskIsAttached(pdName, nodeName)
  	if err != nil {
  		// Log error and continue with detach
  		klog.Errorf(
  			"Error checking if PD (%q) is already attached to current node (%q). Will continue and try detach anyway. err=%v",
  			pdName, nodeName, err)
  	}
  
  	if err == nil && !attached {
  		// Volume is not attached to node. Success!
  		klog.Infof("Detach operation is successful. PD %q was not attached to node %q.", pdName, nodeName)
  		return nil
  	}
  
  	if err = detacher.gceDisks.DetachDisk(pdName, nodeName); err != nil {
  		klog.Errorf("Error detaching PD %q from node %q: %v", pdName, nodeName, err)
  		return err
  	}
  
  	return nil
  }
docs: // Detach checks with the GCE cloud provider if the specified volume is already
  // attached to the specified node. If the volume is not attached, it succeeds
  // (returns nil). If it is attached, Detach issues a call to the GCE cloud
  // provider to attach it.
  // Callers are responsible for retrying on failure.
  // Callers are responsible for thread safety between concurrent attach and detach
  // operations.