code: func NewRESTClient(httpClient *http.Client, host string, auth bool) (gerritpb.GerritClient, error) {
  	switch {
  	case strings.Contains(host, "/"):
  		return nil, errors.Reason("invalid host %q", host).Err()
  	case !strings.HasSuffix(host, "-review.googlesource.com"):
  		return nil, errors.New("Gerrit at googlesource subdomains end with '-review'")
  	}
  
  	baseURL := "https://" + host
  	if auth {
  		baseURL += "/a"
  	}
  	return &client{Client: httpClient, BaseURL: baseURL}, nil
  }
docs: // This file implements Gerrit proto service client
  // on top of Gerrit REST API.
  // WARNING: The returned client is incomplete, so if you want access to
  // a particular field from this API, you may need to update rest.go to add
  // unmarshalling of that field.
  // NewRESTClient creates a new Gerrit client based on Gerrit's REST API.
  //
  // The host must be a full Gerrit host, e.g. "chromium-review.googlesource.com".
  //
  // If auth is true, indicates that the given HTTP client sends authenticated
  // requests. If so, the requests to Gerrit will include "/a/" URL path
  // prefix.
  //
  // RPC methods of the returned client return an error if a grpc.CallOption is
  // passed.