code: func (c *sioClient) WaitForDetachedDevice(token string) error {
  	if token == "" {
  		return fmt.Errorf("invalid detach token")
  	}
  
  	// wait for attach.Token to show up in local device list
  	ticker := time.NewTicker(time.Second)
  	defer ticker.Stop()
  	timer := time.NewTimer(30 * time.Second)
  	defer timer.Stop()
  
  	for {
  		select {
  		case <-ticker.C:
  			devMap, err := c.Devs()
  			if err != nil {
  				klog.Error(log("failed while waiting for volume to unmap/detach: %v", err))
  				return err
  			}
  			go func() {
  				klog.V(4).Info(log("waiting for volume %s to be unmapped/detached", token))
  			}()
  			// cant find vol id, then ok.
  			if _, ok := devMap[token]; !ok {
  				return nil
  			}
  		case <-timer.C:
  			klog.Error(log("timed out while waiting for volume %s to be unmapped/detached", token))
  			return fmt.Errorf("volume detach timeout")
  		}
  	}
  }
docs: // waitForDetachedDevice waits for device to be detached