code: func searchBuilds(ctx context.Context, buildC chan<- *pb.Build, client pb.BuildsClient, req *pb.SearchBuildsRequest) error {
  	// Prepare a channel of responses, s.t. we make an RPC as soon as we started
  	// consuming the response, as opposed to after the response is completely
  	// consumed.
  	resC := make(chan *pb.SearchBuildsResponse)
  	errC := make(chan error)
  	go func() {
  		err := searchResponses(ctx, resC, client, req)
  		close(resC)
  		errC <- err
  	}()
  
  	// Forward builds.
  	for res := range resC {
  		for _, b := range res.Builds {
  			select {
  			case buildC <- b:
  
  			// Note: selecting on errC here would be a race because goroutine
  			// above might have been already done, but we still did not send
  			// all builds to the caller.
  			case <-ctx.Done():
  				return <-errC
  			}
  		}
  	}
  	return <-errC
  }
docs: // searchBuilds is like Search, but does not implement union of search results.
  // Sent builds have ids.