code: func rename(src, dest string) error {
  	// Try to rename generated source.
  	if err := os.Rename(src, dest); err == nil {
  		return nil
  	}
  	// If the rename failed (might do so due to temporary file residing on a
  	// different device), try to copy byte by byte.
  	rc, err := os.Open(src)
  	if err != nil {
  		return err
  	}
  	defer func() {
  		rc.Close()
  		os.Remove(src) // ignore the error, source is in tmp.
  	}()
  
  	if _, err = os.Stat(dest); !os.IsNotExist(err) {
  		if *flagForce {
  			if err = os.Remove(dest); err != nil {
  				return fmt.Errorf("file %q could not be deleted", dest)
  			}
  		} else {
  			return fmt.Errorf("file %q already exists; use -f to overwrite", dest)
  		}
  	}
  
  	wc, err := os.Create(dest)
  	if err != nil {
  		return err
  	}
  	defer wc.Close()
  
  	if _, err = io.Copy(wc, rc); err != nil {
  		// Delete remains of failed copy attempt.
  		os.Remove(dest)
  	}
  	return err
  }
docs: // rename tries to os.Rename, but fall backs to copying from src
  // to dest and unlink the source if os.Rename fails.