code: func (w *Walker) Wait() tfdiags.Diagnostics {
  	// Wait for completion
  	w.wait.Wait()
  
  	var diags tfdiags.Diagnostics
  	w.diagsLock.Lock()
  	for v, vDiags := range w.diagsMap {
  		if _, upstream := w.upstreamFailed[v]; upstream {
  			// Ignore diagnostics for nodes that had failed upstreams, since
  			// the downstream diagnostics are likely to be redundant.
  			continue
  		}
  		diags = diags.Append(vDiags)
  	}
  	w.diagsLock.Unlock()
  
  	return diags
  }
docs: // Wait waits for the completion of the walk and returns diagnostics describing
  // any problems that arose. Update should be called to populate the walk with
  // vertices and edges prior to calling this.
  //
  // Wait will return as soon as all currently known vertices are complete.
  // If you plan on calling Update with more vertices in the future, you
  // should not call Wait until after this is done.