code: func (r *remoteClient) Put(state []byte) error {
  	ctx := context.Background()
  
  	// Read the raw state into a Terraform state.
  	stateFile, err := statefile.Read(bytes.NewReader(state))
  	if err != nil {
  		return fmt.Errorf("Error reading state: %s", err)
  	}
  
  	options := tfe.StateVersionCreateOptions{
  		Lineage: tfe.String(stateFile.Lineage),
  		Serial:  tfe.Int64(int64(stateFile.Serial)),
  		MD5:     tfe.String(fmt.Sprintf("%x", md5.Sum(state))),
  		State:   tfe.String(base64.StdEncoding.EncodeToString(state)),
  	}
  
  	// If we have a run ID, make sure to add it to the options
  	// so the state will be properly associated with the run.
  	if r.runID != "" {
  		options.Run = &tfe.Run{ID: r.runID}
  	}
  
  	// Create the new state.
  	_, err = r.client.StateVersions.Create(ctx, r.workspace.ID, options)
  	if err != nil {
  		r.stateUploadErr = true
  		return fmt.Errorf("Error uploading state: %v", err)
  	}
  
  	return nil
  }
docs: // Put the remote state.