code: func (c *remoteClient) Lock(info *state.LockInfo) (string, error) {
  	// update the path we're using
  	// we can't set the ID until the info is written
  	info.Path = c.lockFileURL()
  
  	infoJson, err := json.Marshal(info)
  	if err != nil {
  		return "", err
  	}
  
  	lockFile := c.lockFile()
  	w := lockFile.If(storage.Conditions{DoesNotExist: true}).NewWriter(c.storageContext)
  	err = func() error {
  		if _, err := w.Write(infoJson); err != nil {
  			return err
  		}
  		return w.Close()
  	}()
  
  	if err != nil {
  		return "", c.lockError(fmt.Errorf("writing %q failed: %v", c.lockFileURL(), err))
  	}
  
  	info.ID = strconv.FormatInt(w.Attrs().Generation, 10)
  
  	return info.ID, nil
  }
docs: // Lock writes to a lock file, ensuring file creation. Returns the generation
  // number, which must be passed to Unlock().