code: func searchResponses(ctx context.Context, resC chan<- *pb.SearchBuildsResponse, client pb.BuildsClient, req *pb.SearchBuildsRequest) error {
  	req = proto.Clone(req).(*pb.SearchBuildsRequest)
  
  	// Ensure next_page_token and build id are requested.
  	if len(req.GetFields().GetPaths()) > 0 {
  		req.Fields.Paths = append(req.Fields.Paths, "next_page_token", "builds.*.id")
  	}
  
  	// Page through results.
  	for {
  		res, err := client.SearchBuilds(ctx, req)
  		if err != nil {
  			return err
  		}
  
  		select {
  		case resC <- res:
  		case <-ctx.Done():
  			return ctx.Err()
  		}
  
  		if res.NextPageToken == "" || len(res.Builds) == 0 {
  			return nil
  		}
  
  		// Next page...
  		req.PageToken = res.NextPageToken
  	}
  }
docs: // searchResponses pages through search results and sends search responses to
  // resC.
  // Builds in resC have ids.