code: func (s *PingService) Do(ctx context.Context) (*PingResult, int, error) {
  	s.client.mu.RLock()
  	basicAuth := s.client.basicAuth
  	basicAuthUsername := s.client.basicAuthUsername
  	basicAuthPassword := s.client.basicAuthPassword
  	s.client.mu.RUnlock()
  
  	url_ := s.url + "/"
  
  	params := make(url.Values)
  	if s.timeout != "" {
  		params.Set("timeout", s.timeout)
  	}
  	if s.pretty {
  		params.Set("pretty", "true")
  	}
  	if len(params) > 0 {
  		url_ += "?" + params.Encode()
  	}
  
  	var method string
  	if s.httpHeadOnly {
  		method = "HEAD"
  	} else {
  		method = "GET"
  	}
  
  	// Notice: This service must NOT use PerformRequest!
  	req, err := NewRequest(method, url_)
  	if err != nil {
  		return nil, 0, err
  	}
  
  	if basicAuth {
  		req.SetBasicAuth(basicAuthUsername, basicAuthPassword)
  	}
  
  	res, err := s.client.c.Do((*http.Request)(req).WithContext(ctx))
  	if err != nil {
  		return nil, 0, err
  	}
  	defer res.Body.Close()
  
  	var ret *PingResult
  	if !s.httpHeadOnly {
  		ret = new(PingResult)
  		if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
  			return nil, res.StatusCode, err
  		}
  	}
  
  	return ret, res.StatusCode, nil
  }
docs: // Do returns the PingResult, the HTTP status code of the Elasticsearch
  // server, and an error.