code: func (r *remoteClient) Lock(info *state.LockInfo) (string, error) {
  	ctx := context.Background()
  
  	lockErr := &state.LockError{Info: r.lockInfo}
  
  	// Lock the workspace.
  	_, err := r.client.Workspaces.Lock(ctx, r.workspace.ID, tfe.WorkspaceLockOptions{
  		Reason: tfe.String("Locked by Terraform"),
  	})
  	if err != nil {
  		if err == tfe.ErrWorkspaceLocked {
  			err = fmt.Errorf("%s (lock ID: \"%s/%s\")", err, r.organization, r.workspace.Name)
  		}
  		lockErr.Err = err
  		return "", lockErr
  	}
  
  	r.lockInfo = info
  
  	return r.lockInfo.ID, nil
  }
docs: // Lock the remote state.